Update app.py
Browse files
app.py
CHANGED
@@ -207,14 +207,16 @@ def server(input, output, session):
|
|
207 |
pitch_input = input.pitch_type()
|
208 |
|
209 |
df_plot_full = df_2024[(df_2024['pitcher_id']==pitcher_input)]
|
|
|
|
|
|
|
210 |
df_plot_full['h_s_b'] = df_plot_full.groupby(['batter_hand','strikes', 'balls']).transform('count')['pitcher_id']
|
211 |
df_plot_full['h_s_b_pitch'] = df_plot_full.groupby(['batter_hand','strikes', 'balls','pitch_type']).transform('count')['pitcher_id']
|
212 |
df_plot_full['h_s_b_pitch_percent'] = df_plot_full['h_s_b_pitch']/df_plot_full['h_s_b']
|
213 |
|
214 |
|
215 |
df_plot = df_plot_full[(df_plot_full['pitch_type']==pitch_input)]
|
216 |
-
|
217 |
-
(pd.to_datetime(df_plot['game_date']).dt.date<=input.date_range_id()[1])]
|
218 |
|
219 |
|
220 |
print("THIS IS HERE")
|
|
|
207 |
pitch_input = input.pitch_type()
|
208 |
|
209 |
df_plot_full = df_2024[(df_2024['pitcher_id']==pitcher_input)]
|
210 |
+
df_plot_full = df_plot_full[(pd.to_datetime(df_plot_full['game_date']).dt.date>=input.date_range_id()[0])&
|
211 |
+
(pd.to_datetime(df_plot_full['game_date']).dt.date<=input.date_range_id()[1])]
|
212 |
+
|
213 |
df_plot_full['h_s_b'] = df_plot_full.groupby(['batter_hand','strikes', 'balls']).transform('count')['pitcher_id']
|
214 |
df_plot_full['h_s_b_pitch'] = df_plot_full.groupby(['batter_hand','strikes', 'balls','pitch_type']).transform('count')['pitcher_id']
|
215 |
df_plot_full['h_s_b_pitch_percent'] = df_plot_full['h_s_b_pitch']/df_plot_full['h_s_b']
|
216 |
|
217 |
|
218 |
df_plot = df_plot_full[(df_plot_full['pitch_type']==pitch_input)]
|
219 |
+
|
|
|
220 |
|
221 |
|
222 |
print("THIS IS HERE")
|