Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -24,17 +24,17 @@ from datetime import datetime, timedelta
|
|
| 24 |
year_input = 2024
|
| 25 |
|
| 26 |
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
|
| 35 |
-
|
| 36 |
|
| 37 |
-
|
| 38 |
|
| 39 |
|
| 40 |
|
|
@@ -46,6 +46,19 @@ df_2023_mlb = dataset_train.to_pandas().set_index(list(dataset_train.features.ke
|
|
| 46 |
|
| 47 |
from api_scraper import MLB_Scrape
|
| 48 |
mlb_stats = MLB_Scrape()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 49 |
data = mlb_stats.get_data(schedule_spring.game_id[:].values)
|
| 50 |
df_2023_new = mlb_stats.get_data_df(data_list = data)
|
| 51 |
df_2023 = pd.concat([df_2023_mlb,df_2023_new])
|
|
|
|
| 24 |
year_input = 2024
|
| 25 |
|
| 26 |
|
| 27 |
+
schedule_spring = mlb_stats.get_schedule(year_input=2024,
|
| 28 |
+
sport_id=1,
|
| 29 |
+
start_date='2024-01-01',
|
| 30 |
+
end_date='2024-12-31',
|
| 31 |
+
final=False,
|
| 32 |
+
regular=True,
|
| 33 |
+
spring=False)
|
| 34 |
|
| 35 |
+
schedule_spring = schedule_spring.drop_duplicates(subset=['game_id'])
|
| 36 |
|
| 37 |
+
schedule_spring = schedule_spring[(schedule_spring['date']==(datetime.today() - timedelta(hours=8)).date())]
|
| 38 |
|
| 39 |
|
| 40 |
|
|
|
|
| 46 |
|
| 47 |
from api_scraper import MLB_Scrape
|
| 48 |
mlb_stats = MLB_Scrape()
|
| 49 |
+
schedule_spring = mlb_stats.get_schedule(year_input=2024,
|
| 50 |
+
sport_id=1,
|
| 51 |
+
start_date='2024-01-01',
|
| 52 |
+
end_date='2024-12-31',
|
| 53 |
+
final=False,
|
| 54 |
+
regular=True,
|
| 55 |
+
spring=False)
|
| 56 |
+
|
| 57 |
+
schedule_spring = schedule_spring.drop_duplicates(subset=['game_id'])
|
| 58 |
+
|
| 59 |
+
schedule_spring = schedule_spring[(schedule_spring['date']==(datetime.today() - timedelta(hours=8)).date())]
|
| 60 |
+
|
| 61 |
+
|
| 62 |
data = mlb_stats.get_data(schedule_spring.game_id[:].values)
|
| 63 |
df_2023_new = mlb_stats.get_data_df(data_list = data)
|
| 64 |
df_2023 = pd.concat([df_2023_mlb,df_2023_new])
|