-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
What is an Injury object? How can it be accessed? #47
Comments
Do you have the exact date for the URL error? If you can provide me with that data, I should be able to look into it and see that the error is. Documentation for the injury object can be located here: http://panz.io/mlbgame/info.m.html#mlbgame.info.Injury Here is a small example of getting injury data: import mlbgame
for injury in mlbgame.injury().injuries:
print(injury.name_first + " " +
injury.name_last + " (" +
injury.position + ") (" +
injury.team_name + ") " +
injury.injury_desc) And the output:
Hopefully this helps, if you need any more information feel free to let me know. |
This really helps! Here's the error: |
I want injury data for all teams for 2000, so I requested game data this way: Then, to get corresponding injuries info, where would I insert the game specific id to request injuries for 2005 in the following code snipped:
Thanks! |
I am not sure if that is currently an option. Currently, the injury function just gets current injury data. I will look into seeing if there is a way to get historical injury data for certain games or certain points in time. |
That would be great. There are a few people that have created Excel sheets on their own with updates from other fans for years 2000 - 2017, but I'm hoping to do a machine learning classification analysis on injuries to predict the likelihood of a player being injured in any game based on other historical stats for that player and that game. The API is awesome, by the way! |
I am trying to create a pandas dataframe of injuries from 2000-2017, with corresponding player profiles. I have a list of injury objects for each game, for each year, but I hit a snag when I was looking for 2005 game data. There was an error for one of the URLs that raised an exception error and crashed the entire 2005 grab.
The challenge I'm having is trying to understand the injury() object. Are there any examples out there or is there documentation that shows some injury data? For all the games in a year, I appended injury() to an injured_list. I can access the injury information by subsetting the injured list, but I can't seem to iterate that list. Any advice or examples would be really helpful.
The text was updated successfully, but these errors were encountered: