You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am currently looping through games in a season to gather data. I then use that game id to generate some more data.
Note the following game IDs
id is 2016_04_03_slnmlb_pitmlb_1
id is 2016_04_03_nynmlb_kcamlb_1
id is 2016_04_03_tormlb_tbamlb_1
id is 2016_04_03_chnmlb_anamlb_1
id is 2016_04_04_phimlb_cinmlb_1
id is 2016_04_04_lanmlb_sdnmlb_1
id is 2016_04_04_colmlb_arimlb_1
id is 2016_04_04_chnmlb_anamlb_1
id is 2016_04_04_sfnmlb_milmlb_1
id is 2016_04_04_tormlb_tbamlb_1
id is 2016_04_04_houmlb_nyamlb_1
When I run
stats=mlbgame.team_stats(game_id)
everything is fine up until the last id
2016_04_04_houmlb_nyamlb_1
I get the following error
Could not find a game with that id.
Any idea how that can happen? The id is generated from the game object itself. Seems a bit odd to me.
Edit: After doing more research I believe what is happening here is that these are game IDs for game that actually didn't happen/post poned. They get a game id but when I try to search for them in in team_stats() it fails.
I am not sure if this was intended or not.
Edit 2:
I ran my program with a try to find which game_ids for the whole season were not able to be found by
mlbgame.team_stats()
They were
CAN'T FIND a game with id of 2016_04_04_bosmlb_clemlb_1
CAN'T FIND a game with id of 2016_04_09_miamlb_wasmlb_1
CAN'T FIND a game with id of 2016_04_10_nyamlb_detmlb_1
CAN'T FIND a game with id of 2016_04_17_balmlb_texmlb_1
CAN'T FIND a game with id of 2016_04_27_milmlb_chnmlb_1
CAN'T FIND a game with id of 2016_04_28_pitmlb_colmlb_1
CAN'T FIND a game with id of 2016_04_30_atlmlb_chnmlb_1
CAN'T FIND a game with id of 2016_05_16_bosmlb_kcamlb_1
CAN'T FIND a game with id of 2016_05_26_chamlb_kcamlb_1
CAN'T FIND a game with id of 2016_09_25_atlmlb_miamlb_1
I assume there would be more than ten rainouts/ cancelled games
The text was updated successfully, but these errors were encountered:
Chances are that those games were cancelled. Can you check if the game type is sg_game? This game type means that the game wasn't played, which could lead to these errors.
So the games that you are getting an error with are games that were not played. Unfortunately, to check this on the API side would be too inefficient for a majority of users and should be done by the client.
In this case, you should check the type of the game and if it is sg_game, do not try to get stats for that game because they don't exist.
I am currently looping through games in a season to gather data. I then use that game id to generate some more data.
Note the following game IDs
When I run
everything is fine up until the last id
2016_04_04_houmlb_nyamlb_1
I get the following error
Could not find a game with that id.
Any idea how that can happen? The id is generated from the game object itself. Seems a bit odd to me.
Edit: After doing more research I believe what is happening here is that these are game IDs for game that actually didn't happen/post poned. They get a game id but when I try to search for them in in team_stats() it fails.
I am not sure if this was intended or not.
Edit 2:
I ran my program with a try to find which game_ids for the whole season were not able to be found by
mlbgame.team_stats()
They were
I assume there would be more than ten rainouts/ cancelled games
The text was updated successfully, but these errors were encountered: