Four datasets have been provided. · cases_by_ward.csv · lives_lost_by_race.csv · lives_lost_by_ward.txt (tab separated, delimiter =’\t’) · total_cases_by_race.csv 1. Import each dataset into a pandas...

Hi I was wondering if you would be able to complete this assignment?


Four datasets have been provided. · cases_by_ward.csv · lives_lost_by_race.csv · lives_lost_by_ward.txt (tab separated, delimiter =’\t’) · total_cases_by_race.csv 1. Import each dataset into a pandas data structure. You need to skip the row for summation (‘All’ in some datasets). Use the first column as the row index. Name the columns or rows using ‘Date’,’Race’,’Ward’ etc if the names do not appear in the imported data structure. Print the first five rows to check the data for each dataset. The example for lives_lost_by_ward is listed below. Date19-Apr20-Apr21-Apr22-Apr23-Apr24-Apr25-Apr26-Apr27-Apr Ward 16668811111112 2. Check each imported pandas data structure for Null values. If there is a null value in that data structure, use the average of values on its previous row and following row in the same column to fill the Null value. (using conditional and loop structures) 3. Convert a new data structure using date as the row index if above four data structures do not use date as the row index 4. For total_cases_by_race, add two new columns, ‘Sum’ and ‘Percentage’. Calculate summation of cases of all dates for each race, and percentage as the total cases for each race out of total cases for all races. Date5-Apr6-Apr...26-Apr27-AprSumPercentage Race Unknown349596….517503104230.179086 5. Plot a dash line for the percentage for each race against each race from above table, add the name for x axis, y axis, add a green color for the line. Use the index from the table as the x ticks with a rotation of 30 degree and a small font size. The example figure is shown below. 6. Join two datasets from cases_by_ward and lives_lost_by_ward with keys of ‘total cases’ and ‘lives lost’, using groupby function and aggregation sum() to get the total number of cases and number of deaths for each ward. You will need to swap the level for summation over all dates. 12… 78UnknownExperienced Homelessness lives_lost7936.0…188.0300.00.076.0 total_cases71344961.5…9154.07950.01789.00.0 7. Calculate the percentage of lives lost to the total cases for each ward, find out the highest percentage for each ward (excluding the data from ‘Experienced Homelessness’). Ward19-Apr20-Apr21-Apr22-Apr23-Apr24-Apr25-Apr26-Apr27-Apr All105112127139153165178185190 16668811111112 2111345678 39910101212121314 4141516171820222323 5121317192123252728 6182123252526272828 7161617182323252525 8222429303336414243 Experienced Homelessness778999999 Unknown000000000
May 13, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here