Skip to content

Instantly share code, notes, and snippets.

@aravindpai
Created February 16, 2020 14:11
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/63176220dbde3e31b5a1babcaa0a8459 to your computer and use it in GitHub Desktop.
Save aravindpai/63176220dbde3e31b5a1babcaa0a8459 to your computer and use it in GitHub Desktop.
sr=batting_df.groupby('year').apply( lambda x: (np.sum(x['runs'].values)/x.shape[0])*100 ).reset_index(name='strike rate')
fig=sr.plot.bar(x="year", y="strike rate", rot=0, title="Team Batting performance over the years",figsize=(10,8)).get_figure()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment