Advertisement
Guest User

Untitled

a guest
Oct 17th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. country_worth = data[data.country.isin(selected_countries)][['country','worth']]
  2. country_worth = country_worth.groupby('country').median()
  3.  
  4. # we visualize the average(median) worth in each country and compare which on has the highest
  5. # or the least
  6. with plt.style.context('fivethirtyeight'):
  7. country_worth.plot(kind='barh',figsize=(10,6),color='purple',alpha=.8)
  8. plt.title('Average worth of Forbes 2018 world\nbillioniares across countries.',
  9. fontsize=15)
  10. plt.xlabel('worth (millions of US dollars)',fontsize=13)
  11. plt.ylabel('country',fontsize=13)
  12. plt.legend(labels=[])
  13. plt.grid(axis='x')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement