題意:
python研究以及可視化一個犯罪統(tǒng)計數(shù)據(jù)集
解析:
taskA:輸出csv文件數(shù)據(jù)集的一些基本信息壳贪,比如數(shù)據(jù)集大小、空值违施、數(shù)據(jù)正確性、統(tǒng)計描述磕蒲、罪行等級等只盹。
讀取csv文件進行data wash:數(shù)據(jù)集大小辣往,是否有空值,日期的格式(統(tǒng)一為日/月/年)站削,對數(shù)據(jù)進行統(tǒng)計運算。
taskB:計算不同郊區(qū)的犯罪次數(shù)與年份之間的關(guān)系—從每年的犯罪次數(shù)许起、不同郊區(qū)的犯罪總數(shù)肛冶、每日犯罪次數(shù)等角度出發(fā)街氢。
年犯罪次數(shù)直接統(tǒng)計(即Offence count求和)睦袖,不同郊區(qū)的犯罪總數(shù)統(tǒng)計(即分類郊區(qū)后再Offence count求和)荣刑,每日犯罪次數(shù)(即犯罪次數(shù)/天數(shù)總和,按不同郊區(qū)分類)
相關(guān)知識點:
I/O文件操作厉亏,數(shù)據(jù)分析,可視化編程爱只,數(shù)理統(tǒng)計
更多詳情加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!