Advertisement
Guest User

Untitled

a guest
Jul 28th, 2016
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. import pandas as pd
  2. import matplotlib as mpl
  3. import matplotlib.pyplot as plt
  4. %matplotlib inline
  5. data=pd.DataFrame({'Rating':['A','AAA','B','BBB','A','AAA','B','BBB'],
  6. 'Score':[2,4,5,6,2,4,5,6,]})
  7. t=data.groupby('Rating', sort=False)['Score'].mean()
  8. t
  9. Rating
  10. A 2
  11. AAA 4
  12. B 5
  13. BBB 6
  14. Name: Score, dtype: int64
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement