<jupyter_start><jupyter_text>1 在Kaggle上下载数据集https://www.kaggle.com/xvivancos/barcelona-data-setsaccidents_2017.csv,并利用学到的python知识对该数据集进行特征分析，特征包括但不限定为下面内容：1）对数据进行归一化处理2）统计星期一到星期日的案件发生数，并画出直方图3）猜测下受伤最严重的案件在时间或者空间分布上有什么特征<jupyter_code>import pandas as pd
import numpy as numpy
import matplotlib.pyplot as plt<jupyter_output><empty_output><jupyter_text>项目依赖引用<jupyter_code>data = pd.read_csv('./work/accidents_2017.csv')
data.head(5)
data_extract_weekday = data['Weekday'].value_counts()
dataFrame_weekday = pd.DataFrame(data_extract_weekday)
print(dataFrame_weekday.sort_values(by = 'Weekday'))<jupyter_output><empty_output><jupyter_text>抽离出Weekday列的数据，并排列显示得上述结果，以下进行归一化处理。<jupyter_code>dataFrame_weekday_percent = dataFrame_weekday / sum(dataFrame_weekday['Weekday'])
print(dataFrame_weekday_percent.sort_values(by = 'Weekday'))<jupyter_output><empty_output><jupyter_text>归一处理后，画直方图与占比图<jupyter_code>plt.barh(range(7), dataFrame_weekday['Weekday'], height=0.7, alpha=0.8)
plt.yticks(range(7), dataFrame_weekday.index)
plt.xlim(800, 1800)
plt.xlabel('Accidents Count')
plt.title('Distribution of Accidents')
plt.show()
plt.pie(dataFrame_weekday_percent['Weekday'], labels=dataFrame_weekday_percent.index, startangle=90, shadow=True)
plt.axis('equal')
plt.legend()
plt.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.12908124525436598, 'fraction_numerical': 0.02126044039483675, 'mean_word_length': 12.049504950495049, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 1, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '445454', 'license': 'MIT', 'n_tokens_mistral': 617, 'n_tokens_neox': 637, 'n_words': 45, 'path': 'Assignment2.ipynb', 'repo_name': 'MijazzChan/AistudioCodeBackup', 'size': '1317'}