a guest Feb 17th, 2020 76 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.csv')
  3. hogwarts_points['faculty_name'] = hogwarts_points['faculty_name'].fillna(value='Гриффиндор')
  4. print ('Сумма баллов в Хогвартсе:', hogwarts_points['points'].sum()) # сумма значений столбца 'points'
  5. print ('Сумма баллов по всем факультетам:', hogwarts_points.groupby('faculty_name')['points'].sum())
  6. print ('Кубок получает', hogwarts_points.groupby('faculty_name')['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