Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import seaborn as sns
- import matplotlib.pyplot as plt
- from pandas import read_csv as ReadCSV
- DF = ReadCSV('Coronavirus.csv').drop_duplicates(subset=['Country'], keep='last', ignore_index=True)
- NonWorldDF = DF[DF['Country'] != 'World']
- MeanDF = NonWorldDF[NonWorldDF['Infected'] > NonWorldDF.mean()[0]].sort_values('Deaths').reset_index(drop=True)
- infectedRatio = MeanDF['Infected'] / MeanDF['Population']
- infectedRadioDensity = MeanDF['Density'] / MeanDF['Infected']
- IMG_1 = sns.barplot(y='Country', x='Infected', data=MeanDF, palette='viridis').get_figure()
- IMG_1.set_size_inches(25, 11.25)
- IMG_1.savefig('Image1.png')
- IMG_2 = sns.barplot(y=MeanDF['Country'], x=infectedRatio.values, palette='viridis').get_figure()
- IMG_2.set_size_inches(25, 11.25)
- IMG_2.savefig('Image2.png')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement