0

I have a csv with millions of lines of data. I'm looking to sum up all values of "event" column by "shooterName" - the possible values of the 'event' column are; goal, shot, miss. For instance shooterName_a: 99 goal, 88 shot, 77 miss. shooterName_b: 98 goal, 89 shot, 79 miss... etc..

import pandas as pd
    
df = pd.read_csv('NHL_Project/Data/shots_2007-2020.csv')

op=df(['season','period','teamCode','event','goal','xCord','xCordAdjusted','yCord','yCordAdjusted','shotType','playerPositionThatDidEvent','playerNumThatDidEvent','shooterPlayerId','shooterName','shooterLeftRight'])
xp['shot']= xp.period / xp.period
season_df = xp.loc[(op['season'] >= 2007)]
shots = season_df.loc[(season_df.event.isin(['SHOT','GOAL','MISS']))]
goals = shots[shots.event.isin(['GOAL'])]
misses = shots[shots.event.isin(['MISS'])]
saved_shot = shots[shots.event.isin(['SHOT'])]
jhh19
  • 51
  • 5

0 Answers0