Created
February 16, 2020 14:06
-
-
Save aravindpai/4813683c98b48f584c9c0e2d99209979 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
df1 = grp.groupby('bowling_team').apply(lambda x:x.shape[0]).reset_index(name='no') | |
df2=grp.groupby('bowling_team').apply(lambda x: x[x['innings_no']==x['result']].shape[0]).reset_index(name='won') | |
df2['Win %']=df2['won']/df1['no'] | |
fig=df2.plot.bar(x="bowling_team", y="Win %", rot=0, title="Win % against different teams",figsize=(10,8)).get_figure() #weighted |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment