Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pandas as pd
- import matplotlib as mpl
- import matplotlib.pyplot as plt
- %matplotlib inline
- data=pd.DataFrame({'Rating':['A','AAA','B','BBB','A','AAA','B','BBB'],
- 'Score':[2,4,5,6,2,4,5,6,]})
- t=data.groupby('Rating', sort=False)['Score'].mean()
- t
- Rating
- A 2
- AAA 4
- B 5
- BBB 6
- Name: Score, dtype: int64
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement