Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Let's visulaize the distribution of worth across age groups
- ageNworth = data[['age_group','worth']]
- # display the age and worth data
- ageNworth.head()
- # Here we will use a box plot to visualize the distribution of worth across age groups
- # since the distributions might not be a normal or may be skewed.
- plt.figure(figsize=(16,7))
- sns.boxplot(y='age_group',x='worth',data=ageNworth,orient='h')
- plt.title('Distribution of worth of Forbes 2018 world\nbillioniares across age groups',fontsize=14)
- plt.xlabel('worth (millions of US dollars)',fontsize=14)
- plt.ylabel('Age group',fontsize=14)
- plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement