莫納什大學(xué)FIT1043?課業(yè)解析

題意:


python研究以及可視化一個犯罪統(tǒng)計數(shù)據(jù)集

圖片發(fā)自簡書App

解析:

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:



圖片發(fā)自簡書App

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!

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末疯暑,一起剝皮案震驚了整個濱河市,隨后出現(xiàn)的幾起案子妇拯,更是在濱河造成了極大的恐慌,老刑警劉巖洗鸵,帶你破解...
    沈念sama閱讀 217,084評論 6 503
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件皇型,死亡現(xiàn)場離奇詭異综液,居然都是意外死亡汰聋,警方通過查閱死者的電腦和手機萝快,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 92,623評論 3 392
  • 文/潘曉璐 我一進店門贡翘,熙熙樓的掌柜王于貴愁眉苦臉地迎上來蹈矮,“玉大人鸣驱,你說我怎么就攤上這事∮欢” “怎么了?”我有些...
    開封第一講書人閱讀 163,450評論 0 353
  • 文/不壞的土叔 我叫張陵再芋,是天一觀的道長。 經(jīng)常有香客問我济赎,道長,這世上最難降的妖魔是什么司训? 我笑而不...
    開封第一講書人閱讀 58,322評論 1 293
  • 正文 為了忘掉前任液南,我火速辦了婚禮,結(jié)果婚禮上滑凉,老公的妹妹穿的比我還像新娘。我一直安慰自己咒钟,他們只是感情好,可當我...
    茶點故事閱讀 67,370評論 6 390
  • 文/花漫 我一把揭開白布盯腌。 她就那樣靜靜地躺著,像睡著了一般腕够。 火紅的嫁衣襯著肌膚如雪。 梳的紋絲不亂的頭發(fā)上玫荣,一...
    開封第一講書人閱讀 51,274評論 1 300
  • 那天大诸,我揣著相機與錄音捅厂,去河邊找鬼资柔。 笑死,一個胖子當著我的面吹牛贿堰,可吹牛的內(nèi)容都是我干的。 我是一名探鬼主播羹与,決...
    沈念sama閱讀 40,126評論 3 418
  • 文/蒼蘭香墨 我猛地睜開眼纵搁,長吁一口氣:“原來是場噩夢啊……” “哼吃衅!你這毒婦竟也來了腾誉?” 一聲冷哼從身側(cè)響起,我...
    開封第一講書人閱讀 38,980評論 0 275
  • 序言:老撾萬榮一對情侶失蹤惑灵,失蹤者是張志新(化名)和其女友劉穎山上,沒想到半個月后,有當?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體佩憾,經(jīng)...
    沈念sama閱讀 45,414評論 1 313
  • 正文 獨居荒郊野嶺守林人離奇死亡,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點故事閱讀 37,599評論 3 334
  • 正文 我和宋清朗相戀三年楞黄,在試婚紗的時候發(fā)現(xiàn)自己被綠了。 大學(xué)時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片鬼廓。...
    茶點故事閱讀 39,773評論 1 348
  • 序言:一個原本活蹦亂跳的男人離奇死亡,死狀恐怖尤慰,靈堂內(nèi)的尸體忽然破棺而出雷蹂,到底是詐尸還是另有隱情伟端,我是刑警寧澤匪煌,帶...
    沈念sama閱讀 35,470評論 5 344
  • 正文 年R本政府宣布,位于F島的核電站萎庭,受9級特大地震影響,放射性物質(zhì)發(fā)生泄漏驳规。R本人自食惡果不足惜,卻給世界環(huán)境...
    茶點故事閱讀 41,080評論 3 327
  • 文/蒙蒙 一值朋、第九天 我趴在偏房一處隱蔽的房頂上張望巩搏。 院中可真熱鬧昨登,春花似錦贯底、人聲如沸。這莊子的主人今日做“春日...
    開封第一講書人閱讀 31,713評論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽胚想。三九已至,卻和暖如春浊服,著一層夾襖步出監(jiān)牢的瞬間胚吁,已是汗流浹背愁憔。 一陣腳步聲響...
    開封第一講書人閱讀 32,852評論 1 269
  • 我被黑心中介騙來泰國打工, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留吨掌,地道東北人。 一個月前我還...
    沈念sama閱讀 47,865評論 2 370
  • 正文 我出身青樓代虾,卻偏偏與公主長得像,于是被迫代替她去往敵國和親棉磨。 傳聞我的和親對象是個殘疾皇子,可洞房花燭夜當晚...
    茶點故事閱讀 44,689評論 2 354

推薦閱讀更多精彩內(nèi)容