Advertisement
Guest User

Untitled

a guest
Oct 17th, 2019
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. # Let's visulaize the distribution of worth across age groups
  2. ageNworth = data[['age_group','worth']]
  3.  
  4. # display the age and worth data
  5. ageNworth.head()
  6.  
  7. # Here we will use a box plot to visualize the distribution of worth across age groups
  8. # since the distributions might not be a normal or may be skewed.
  9. plt.figure(figsize=(16,7))
  10. sns.boxplot(y='age_group',x='worth',data=ageNworth,orient='h')
  11. plt.title('Distribution of worth of Forbes 2018 world\nbillioniares across age groups',fontsize=14)
  12. plt.xlabel('worth (millions of US dollars)',fontsize=14)
  13. plt.ylabel('Age group',fontsize=14)
  14. plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement