daily pastebin goal
6%
SHARE
TWEET

Untitled

a guest Feb 13th, 2018 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. classes = [pd.DataFrame(titanic[titanic.Pclass == i]['Age']) for i in range(1,4)]
  2. f, ax = plt.subplots(1,3, sharey=True,figsize=(16,5))
  3. ax[0].set_ylabel('Scaled number of passengers')
  4. for i in range(3):
  5.     ax[i].hist(classes[i].values, 30,
  6.         color='blue',
  7.         #linewidths=1,
  8.         normed=True)
  9.     ax[i].set_title('Class '+str(i+1))
  10.     ax[i].set_xlabel('Age')
  11. plt.show()
  12. #classes[0]
  13. #titanic[titanic.Pclass == 1].groupby(['Age']).size()/maxCount
  14. #maxCount
  15. #classes[0].values
  16. #np.random.randn(1000)
RAW Paste Data
Top