Advertisement
EXTREMEXPLOIT

Coronavirus Plots

Sep 18th, 2020
1,417
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.78 KB | None | 0 0
  1. import seaborn as sns
  2. import matplotlib.pyplot as plt
  3. from pandas import read_csv as ReadCSV
  4.  
  5. DF = ReadCSV('Coronavirus.csv').drop_duplicates(subset=['Country'], keep='last', ignore_index=True)
  6. NonWorldDF = DF[DF['Country'] != 'World']
  7. MeanDF = NonWorldDF[NonWorldDF['Infected'] > NonWorldDF.mean()[0]].sort_values('Deaths').reset_index(drop=True)
  8. infectedRatio = MeanDF['Infected'] / MeanDF['Population']
  9. infectedRadioDensity = MeanDF['Density'] / MeanDF['Infected']
  10.  
  11.  
  12. IMG_1 = sns.barplot(y='Country', x='Infected', data=MeanDF, palette='viridis').get_figure()
  13. IMG_1.set_size_inches(25, 11.25)
  14. IMG_1.savefig('Image1.png')
  15.  
  16. IMG_2 = sns.barplot(y=MeanDF['Country'], x=infectedRatio.values, palette='viridis').get_figure()
  17. IMG_2.set_size_inches(25, 11.25)
  18. IMG_2.savefig('Image2.png')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement