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