text_plain_output_1.png image_output_1.png
import matplotlib.pyplot as plt

import numpy as np # linear algebra

import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)

p = pd.read_csv('/kaggle/input/uncover/UNCOVER/canadian_outbreak_tracker/canada-cumulative-case-count-by-new-hybrid-regional-health-boundaries.csv')

p.isnull().any()

p['deaths'] = p['deaths'].fillna(0)
p['recovered'] = p['recovered'].fillna(0)
p['tests'] = np.where(p['tests'].isnull(), p['casecount'], p['tests'])

p.drop(p.columns[[4, 30, 31, 32, 33, 34, 35]], axis=1, inplace=True)

import seaborn as sns
import matplotlib.pyplot as plt
y = p[['pop0to4_2019', 'pop5to9_2019', 'pop10to14_2019', 'pop15to19_2019', 'pop20to24_2019', 'pop25to29_2019', 'pop30to34_2019', 'pop35to39_2019', 'pop40to44_2019', 'pop45to49_2019', 'pop50to54_2019', 'pop55to59_2019', 'pop60to64_2019', 'pop65to69_2019', 'pop70to74_2019', 'pop75to79_2019', 'pop80to84_2019', 'pop85older']]

plt.figure(figsize=(20, 20))
plt.bar('deaths', 'pop0to4_2019', data=p)
plt.bar('deaths', 'pop5to9_2019', data=p)
plt.bar('deaths', 'pop10to14_2019', data=p)
plt.bar('deaths', 'pop15to19_2019', data=p)
plt.bar('deaths', 'pop20to24_2019', data=p)
plt.bar('deaths', 'pop25to29_2019', data=p)
plt.bar('deaths', 'pop30to34_2019', data=p)
plt.bar('deaths', 'pop35to39_2019', data=p)
plt.bar('deaths', 'pop40to44_2019', data=p)
plt.bar('deaths', 'pop45to49_2019', data=p)
plt.bar('deaths', 'pop50to54_2019', data=p, color='black')
plt.bar('deaths', 'pop55to59_2019', data=p, color='maroon')
plt.bar('deaths', 'pop60to64_2019', data=p, color='greenyellow')
plt.bar('deaths', 'pop65to69_2019', data=p, color='floralwhite')
plt.bar('deaths', 'pop70to74_2019', data=p, color='indigo')
plt.bar('deaths', 'pop75to79_2019', data=p, color='crimson')
plt.bar('deaths', 'pop80to84_2019', data=p, color='lightpink')
plt.bar('deaths', 'pop85older_2019', data=p, color='slategrey')
plt.xticks(np.arange(0, 34, 2))
plt.xlabel('Deaths')
plt.ylabel('Population categories distribution')
plt.title('DEATHS PER POPULATION')
plt.legend(y, loc='best')