Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -202,10 +202,16 @@ def server(input, output, session):
|
|
| 202 |
def player_select_ui():
|
| 203 |
# Get the list of pitchers for the selected level and season
|
| 204 |
df_pitcher_info = scrape.get_players(sport_id=int(input.level_input()), season=int(input.year_input()), game_type = [input.type_input()]).filter(
|
| 205 |
-
pl.col("position").is_in(['P','TWP']))
|
|
|
|
|
|
|
|
|
|
| 206 |
|
| 207 |
# Create a dictionary of pitcher IDs and names
|
| 208 |
pitcher_dict = dict(zip(df_pitcher_info['player_id'], df_pitcher_info['name']))
|
|
|
|
|
|
|
|
|
|
| 209 |
|
| 210 |
# Return a select input for choosing a pitcher
|
| 211 |
return ui.input_select("pitcher_id", "Select Pitcher", pitcher_dict, selectize=True)
|
|
|
|
| 202 |
def player_select_ui():
|
| 203 |
# Get the list of pitchers for the selected level and season
|
| 204 |
df_pitcher_info = scrape.get_players(sport_id=int(input.level_input()), season=int(input.year_input()), game_type = [input.type_input()]).filter(
|
| 205 |
+
(pl.col("position").is_in(['P','TWP']))|
|
| 206 |
+
(pl.col("player_id").is_in([686846]))
|
| 207 |
+
|
| 208 |
+
).sort("name")
|
| 209 |
|
| 210 |
# Create a dictionary of pitcher IDs and names
|
| 211 |
pitcher_dict = dict(zip(df_pitcher_info['player_id'], df_pitcher_info['name']))
|
| 212 |
+
|
| 213 |
+
|
| 214 |
+
|
| 215 |
|
| 216 |
# Return a select input for choosing a pitcher
|
| 217 |
return ui.input_select("pitcher_id", "Select Pitcher", pitcher_dict, selectize=True)
|