Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -702,15 +702,19 @@ with tab3:
|
|
| 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")
|
| 713 |
-
fig, ax1 = plt.subplots(figsize=(20,
|
| 714 |
|
| 715 |
color = 'tab:blue'
|
| 716 |
ax1.set_xlabel('Date')
|
|
@@ -723,7 +727,7 @@ with tab3:
|
|
| 723 |
st.image(buf)
|
| 724 |
elif plot_count == "Two":
|
| 725 |
graph_data = working_data.reindex(['Date', plot_var1, plot_var2],axis="columns")
|
| 726 |
-
fig, ax1 = plt.subplots(figsize=(20,
|
| 727 |
|
| 728 |
color = 'tab:blue'
|
| 729 |
ax1.set_xlabel('Date')
|
|
@@ -743,7 +747,7 @@ with tab3:
|
|
| 743 |
st.image(buf)
|
| 744 |
elif plot_count == "Three":
|
| 745 |
graph_data = working_data.reindex(['Date', plot_var1, plot_var2, plot_var3],axis="columns")
|
| 746 |
-
fig, ax1 = plt.subplots(figsize=(20,
|
| 747 |
|
| 748 |
color = 'tab:blue'
|
| 749 |
color2 = 'tab:orange'
|
|
|
|
| 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['Date'] = pd.to_datetime(working_data['Date'])
|
| 706 |
+
working_data = working_data.set_index('Date')
|
| 707 |
working_data = working_data[plot_var1].rolling('5D').mean()
|
| 708 |
elif date_var_3 == '10-day Averages':
|
| 709 |
+
working_data['Date'] = pd.to_datetime(working_data['Date'])
|
| 710 |
+
working_data = working_data.set_index('Date')
|
| 711 |
working_data = working_data[plot_var1].rolling('10D').mean()
|
| 712 |
else:
|
| 713 |
working_data = working_data
|
| 714 |
|
| 715 |
if plot_count == "One":
|
| 716 |
graph_data = working_data.reindex(['Date', plot_var1],axis="columns")
|
| 717 |
+
fig, ax1 = plt.subplots(figsize=(20, 10), layout='tight')
|
| 718 |
|
| 719 |
color = 'tab:blue'
|
| 720 |
ax1.set_xlabel('Date')
|
|
|
|
| 727 |
st.image(buf)
|
| 728 |
elif plot_count == "Two":
|
| 729 |
graph_data = working_data.reindex(['Date', plot_var1, plot_var2],axis="columns")
|
| 730 |
+
fig, ax1 = plt.subplots(figsize=(20, 10), layout='tight')
|
| 731 |
|
| 732 |
color = 'tab:blue'
|
| 733 |
ax1.set_xlabel('Date')
|
|
|
|
| 747 |
st.image(buf)
|
| 748 |
elif plot_count == "Three":
|
| 749 |
graph_data = working_data.reindex(['Date', plot_var1, plot_var2, plot_var3],axis="columns")
|
| 750 |
+
fig, ax1 = plt.subplots(figsize=(20, 10), layout='tight')
|
| 751 |
|
| 752 |
color = 'tab:blue'
|
| 753 |
color2 = 'tab:orange'
|