题意:
python研究以及可视化一个犯罪统计数据集
解析:
taskA:输出csv文件数据集的一些基本信息,比如数据集大小、空值、数据正确性、统计描述、罪行等级等。
读取csv文件进行data wash:数据集大小,是否有空值,日期的格式(统一为日/月/年),对数据进行统计运算。
taskB:计算不同郊区的犯罪次数与年份之间的关系—从每年的犯罪次数、不同郊区的犯罪总数、每日犯罪次数等角度出发。
年犯罪次数直接统计(即Offence count求和),不同郊区的犯罪总数统计(即分类郊区后再Offence count求和),每日犯罪次数(即犯罪次数/天数总和,按不同郊区分类)
相关知识点:
I/O文件操作,数据分析,可视化编程,数理统计
更多详情加VX:
FIT1043 Assignment 1: DescriptionDue date: Friday 30th August 2019- 11:55 pmAimThe aim of this assignment is to investigate and visualise data using Python as a data science tool.It will test your ability to:1. read a data file in Python and extract related data from it;2. use various graphical and non-graphical tools for performing exploratory data analysis and visualisation;3. use basic tools for managing and processing data; and4. communicate your findings in your report.DataThe data we will use contains Suburb-based crime statistics for crimes against the person and crimes against property in South Australia and comes from the South Australian Government.• The Crime statistics dataset (Crime_Statistics_SA_2014_2019.csv file) contains all offences against the person and property that were reported to police between 2014 to 2019 in South Australian suburbs.• The dataset contains information about the crime reported date, suburb incident occurred, Postcode, 3 levels of description of the offence, and the offence count.• The file is available on Moodle and is publicly available from data.sa.gov.au on a yearly basis. Hand-in Requirements Please hand in a PDF file containing your answers and a Jupyter notebook file (.ipynb) containing your Python code to all the questions respectively: A PDF file should contain:1. Answers to the questions. Make sure to include screenshots/images of the graphs you generate and your Python code in order to justify your answers to all the questions. (You will need to use screen-capture functionality to create appropriate images.)2. You can use Word or other word processing software to format your submission. Just save the final copy to a PDF before submitting. Ipynb file should contain:1. A copy of your working Python code to answer the questions. You will need to submit two separate files. Zip, rar or any other similar file compression format is not acceptable and will have a penalty of 10%.Python AvailabilityYou will need to use Python to complete the assignment. You can do this by either:1. running a Jupyter Notebook on a computer in the labs; or2. installing Python (we recommend Anaconda) on your own machine.Assignment Tasks:There are two tasks that you need to complete for this assignment. Students that complete only tasks A1-A6 and B1 and B2 can only get a maximum of Distinction. Students that attempt task B3 will be showing critical analysis skills and a deeper understanding of the task at hand and can achieve the highest grade. You need to use Python to complete the tasks.Task A: Data Exploration and AuditingIn this task, you are required to explore the dataset and do some data auditing on the crime statistics dataset. Have a look at the CSV file (Crime_Statistics_SA_2014_2019.csv) and then answer a series of questions about the data using Python.A1. Dataset sizeHow many rows and columns exist in this dataset?A2. Null values in the datasetAre there any null values in this dataset?A3. Data TypesWhat are the min and max for column 'Reported Date '? Does this column have the correct data type? If no, convert it to an appropriate data type.A4. Descriptive statisticsCalculate the statistics for the "Offence Count" column (Find the count, mean, standard deviation, minimum and maximum).A5. Exploring Offence Level 1 DescriptionNow look at the Offence Level 1 Description column and answer the following questions1. How many unique values does "Offence Level 1 Description" column take?2. Display the unique values of level 1 offences.3. How many records do contain "offences against the person"?4. What percentage of the records are "offences against the property"?A6. Exploring Offence Level 2 DescriptionNow look at the Offence Level 2 Description column and answer the following questions1. How many unique values does "Offence Level 2 Description" column take? Display the unique values of level 2 offences together with their counts (i.e., how many times they have been repeated).2. How many serious criminal trespasses have occurred with more than 1 offence count?Task B: Investigating Offence Count in different suburbs and different yearsIn the task, you are required to visualise the relationship between the number of crimes in different suburbs and different years and exploring the relationship. Note: higher marks will be given to reports containing graphs with appropriately labelled axes, title and legend.B1. Investigating the number of crimes per yearFind the number of crimes per year. Plot the graph and explain your understanding of the graph. Hint: you can extract ‘year’ from column "reported date" using method .dt and create a new column for the year in your dataframe as follows:>>> your_dataframe['year']=your_dataframe['Reported Date'].dt.yearB2. Investigating the total number of crimes in different suburbs1. Compute the total number of crimes in each suburb and plot a histogram of the total number of crimes in different suburbs2. Consider the shape of the histogram, what can you tell? Compare the mean and median values of the plotted histogram.3. In which suburbs the total number of crimes are greater than 5000? Plot the total number of crimes in the suburbs with the highest number of crimes (greater than 5000) using a bar chart.B3. Daily number of crimes1. For each suburb, calculate the number of days that at least 15 crimes have occurred per day. (Note: your answer should contain all suburbs in the dataset together with a value showing the number of days that at least 15 crimes have happened)2. Now which suburbs do have at least one day where the daily number of crimes are more than 15. Plot the number of days that at least 15 crimes have occurred for the suburbs you found in this step (step 2) using a bar graph.3. Use an appropriate graph to visualize and detect outliers (extreme values) on the data from step 2 and remove them. Then, plot the data again using a bar graph.4. Compare the bar graphs in step 2 and 3. Which bar graph is easier to interpret? Why?
Good Luck!