Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -683,7 +683,7 @@ with tab3:
|
|
683 |
plot_var2 = st.selectbox("Which stat are you viewing?", stat_drop, key='plot_var2')
|
684 |
plot_var3 = st.selectbox("Which stat are you viewing?", stat_drop, key='plot_var3')
|
685 |
|
686 |
-
date_var_3 = st.radio("Would you like to view all dates or specific ones?", ('All', 'Specific Dates'), key='date_var_3')
|
687 |
|
688 |
if date_var_3 == 'Specific Dates':
|
689 |
plot_low_date = st.date_input('Min Date:', value=None, format="YYYY-MM-DD", key='plot_low_date')
|
@@ -692,7 +692,7 @@ with tab3:
|
|
692 |
plot_high_date = st.date_input('Max Date:', value=None, format="YYYY-MM-DD", key='plot_high_date')
|
693 |
if plot_high_date is not None:
|
694 |
plot_high_date = pd.to_datetime(plot_high_date).date()
|
695 |
-
|
696 |
plot_low_date = pitcher_gamelog_table['Date'].min()
|
697 |
plot_high_date = pitcher_gamelog_table['Date'].max()
|
698 |
|
@@ -701,6 +701,12 @@ with tab3:
|
|
701 |
working_data = working_data[working_data['Date'] <= sp_high_date]
|
702 |
working_data = working_data[working_data['Team'].isin(sp_team_var1)]
|
703 |
working_data = working_data[working_data['Player'] == player_var3]
|
|
|
|
|
|
|
|
|
|
|
|
|
704 |
|
705 |
if plot_count == "One":
|
706 |
graph_data = working_data.reindex(['Date', plot_var1],axis="columns")
|
|
|
683 |
plot_var2 = st.selectbox("Which stat are you viewing?", stat_drop, key='plot_var2')
|
684 |
plot_var3 = st.selectbox("Which stat are you viewing?", stat_drop, key='plot_var3')
|
685 |
|
686 |
+
date_var_3 = st.radio("Would you like to view all dates or specific ones?", ('All', 'Specific Dates', '5-day Averages', '10-day Averages'), key='date_var_3')
|
687 |
|
688 |
if date_var_3 == 'Specific Dates':
|
689 |
plot_low_date = st.date_input('Min Date:', value=None, format="YYYY-MM-DD", key='plot_low_date')
|
|
|
692 |
plot_high_date = st.date_input('Max Date:', value=None, format="YYYY-MM-DD", key='plot_high_date')
|
693 |
if plot_high_date is not None:
|
694 |
plot_high_date = pd.to_datetime(plot_high_date).date()
|
695 |
+
else:
|
696 |
plot_low_date = pitcher_gamelog_table['Date'].min()
|
697 |
plot_high_date = pitcher_gamelog_table['Date'].max()
|
698 |
|
|
|
701 |
working_data = working_data[working_data['Date'] <= sp_high_date]
|
702 |
working_data = working_data[working_data['Team'].isin(sp_team_var1)]
|
703 |
working_data = working_data[working_data['Player'] == player_var3]
|
704 |
+
if date_var_3 == '5-day Averages':
|
705 |
+
working_data = working_data[plot_var1].rolling('5D').mean()
|
706 |
+
elif date_var_3 == '10-day Averages':
|
707 |
+
working_data = working_data[plot_var1].rolling('10D').mean()
|
708 |
+
else:
|
709 |
+
working_data = working_data
|
710 |
|
711 |
if plot_count == "One":
|
712 |
graph_data = working_data.reindex(['Date', plot_var1],axis="columns")
|