Advertisement
brainuser5705

pie chart w. matplotlib

Jun 21st, 2022
773
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.32 KB | None | 0 0
  1. import matplotlib as mpl
  2. import matplotlib.pyplot as plt
  3.  
  4. # Shows a pie chart of all survivors and their embarked destination
  5. train_copy_survived = train_copy[(train_copy['Survived'] == 1)]
  6. embarked_sizes = train_copy['Embarked'].value_counts()
  7.  
  8. plt.pie(x=embarked_sizes.values, labels=embarked_sizes.index)
  9. plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement