Last active
February 19, 2020 05:24
-
-
Save aravindpai/dc5537bf5426820a45fe1993edbd7590 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
num1=powerplay_batting_df.shape[0]/powerplay_batting_df['runs'].value_counts()[4] | |
num2=middle_batting_df.shape[0]/middle_batting_df['runs'].value_counts()[4] | |
num3=last_batting_df.shape[0]/last_batting_df['runs'].value_counts()[4] | |
x_axis = ['PP','Middle','Last'] | |
y_axis = [num1, num2, num3] | |
dataframe= pd.DataFrame({'overs':x_axis,'4':y_axis}) | |
num1=powerplay_batting_df.shape[0]/powerplay_batting_df['runs'].value_counts()[6] | |
num2=middle_batting_df.shape[0]/middle_batting_df['runs'].value_counts()[6] | |
num3=last_batting_df.shape[0]/last_batting_df['runs'].value_counts()[6] | |
dataframe['6'] = [num1,num2,num3] | |
data = {"4":dataframe['4'].values, | |
"6":dataframe['6'].values | |
}; | |
index = dataframe['overs'].values | |
# Dictionary loaded into a DataFrame | |
dataFrame = pd.DataFrame(data=data, index=index); | |
# Draw a vertical bar chart | |
fig = dataFrame.plot.bar(rot=0, title="Avg no. of balls to score boundary(overs wise)",figsize=(10,8)).get_figure() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment