Skip to content

Instantly share code, notes, and snippets.

@aravindpai
Created February 16, 2020 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aravindpai/4cebc87d0371279101089782ddb4b570 to your computer and use it in GitHub Desktop.
Save aravindpai/4cebc87d0371279101089782ddb4b570 to your computer and use it in GitHub Desktop.
score = batting_df.groupby(['year','match','innings_no']).apply(lambda x:x['runs'].sum()).reset_index(name='score')
print("Batting First Average score:",np.median(score[score['innings_no']==1]['score'].values))
print("Batting Second Average score:",np.median(score[score['innings_no']==2]['score'].values))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment