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