SHARE
TWEET

Untitled

a guest Jan 28th, 2020 83 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import pandas as pd
  2. hogwarts_points = pd.read_csv('/datasets/hogwarts_points_eng.csv')
  3. hogwarts_points['house'] = hogwarts_points['house'].fillna(value='Gryffindor')
  4. print ('Total points for Hogwarts:', hogwarts_points['points'].sum())
  5. print ('Total points by house:', hogwarts_points.groupby('house')['points'].sum())
  6. print ('The Cup goes to', hogwarts_points.groupby('house')['points'].sum().idxmax())
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top