Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pandas as pd
- hogwarts_points = pd.read_csv('/datasets/hogwarts_points_eng.csv')
- hogwarts_points['house'] = hogwarts_points['house'].fillna(value='Gryffindor')
- print ('Total points for Hogwarts:', hogwarts_points['points'].sum())
- print ('Total points by house:', hogwarts_points.groupby('house')['points'].sum())
- print ('The Cup goes to', hogwarts_points.groupby('house')['points'].sum().idxmax())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement