联系方式

  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-23:00
  • 微信:codinghelp

您当前位置:首页 >> Python编程Python编程

日期:2019-08-27 11:18

FIT1043 Assignment 1: Description

Aim

The 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; and

4. communicate your findings in your report.

Data

The 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 Availability

You 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; or

2. 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 Auditing

In 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 size

How many rows and columns exist in this dataset?

A2. Null values in the dataset

Are there any null values in this dataset?

A3. Data Types

What 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 statistics

Calculate the statistics for the "Offence Count" column (Find the count, mean, standard deviation,

minimum and maximum).

A5. Exploring Offence Level 1 Description

Now look at the Offence Level 1 Description column and answer the following questions

1. 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 Description

Now look at the Offence Level 2 Description column and answer the following questions

1. 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 years

In 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 year

Find 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.year

B2. Investigating the total number of crimes in different suburbs

1. Compute the total number of crimes in each suburb and plot a histogram of the total

number of crimes in different suburbs

2. 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 crimes

1. 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!


版权所有:留学生编程辅导网 2020 All Rights Reserved 联系方式:QQ:99515681 微信:codinghelp 电子信箱:99515681@qq.com
免责声明:本站部分内容从网络整理而来,只供参考!如有版权问题可联系本站删除。 站长地图

python代写
微信客服:codinghelp