Skip to content

Commit

Permalink
fifties issue
Browse files Browse the repository at this point in the history
  • Loading branch information
shan1322 committed Jul 10, 2022
1 parent 875aaad commit af88a17
Showing 1 changed file with 23 additions and 10 deletions.
33 changes: 23 additions & 10 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,17 +125,30 @@ def get_hundred_insights(df, strike_rate, mile_stone):
win_percentage_inn2 = mwi2h / len(df_i2)
hundered_df = pd.DataFrame()
hundered_df['innings'] = ["innings1", "innings2"]
hundered_df['hundreds'] = [len(df_i1), len(df_i2)]
hundered_df['win_percentage'] = [win_percentage_inn1 * 100, win_percentage_inn2 * 100]
if mile_stone == "fifty":
hundered_df['fifties'] = [len(df_i1), len(df_i2)]
hundered_df['win_percentage'] = [win_percentage_inn1 * 100, win_percentage_inn2 * 100]
fig = simple_bar_plot(data=hundered_df, x="innings", y="fifties",
color_column="fifties")
st.header("innings wise Fifties")
st.plotly_chart(fig, use_container_width=True)
fig = simple_bar_plot(data=hundered_df, x="innings", y="win_percentage",
color_column="win_percentage")
st.header("win percentage when fifties scored in innings 1 vs fifties scored in innings 2")
st.plotly_chart(fig, use_container_width=True)

fig = simple_bar_plot(data=hundered_df, x="innings", y="hundreds",
color_column="hundreds")
st.header("innings wise hundred")
st.plotly_chart(fig, use_container_width=True)
fig = simple_bar_plot(data=hundered_df, x="innings", y="win_percentage",
color_column="win_percentage")
st.header("win percentage when hundred scored in innings 1 vs hundred scored in innings 2")
st.plotly_chart(fig, use_container_width=True)

else:
hundered_df['hundreds'] = [len(df_i1), len(df_i2)]
hundered_df['win_percentage'] = [win_percentage_inn1 * 100, win_percentage_inn2 * 100]
fig = simple_bar_plot(data=hundered_df, x="innings", y="hundreds",
color_column="hundreds")
st.header("innings wise hundred")
st.plotly_chart(fig, use_container_width=True)
fig = simple_bar_plot(data=hundered_df, x="innings", y="win_percentage",
color_column="win_percentage")
st.header("win percentage when hundred scored in innings 1 vs hundred scored in innings 2")
st.plotly_chart(fig, use_container_width=True)


def get_batting_details(df, player, batting_df):
Expand Down

0 comments on commit af88a17

Please sign in to comment.