TypeError from trying to convert NoneType to int in sportsreference.ncaaf.teams.schedule.dataframe_extended
See original GitHub issue``Traceback (most recent call last):
`` File “./scrape.py”, line 28, in <module>
`` sched = getScheduleDF(team, yr)
`` File “./scrape.py”, line 15, in getScheduleDF
`` df = sched.dataframe_extended
`` File “/home/chris/.local/lib/python3.6/site-packages/sportsreference/ncaaf/schedule.py”, line 459, in dataframe_extended
`` frames.append(game.dataframe_extended)
File "/home/chris/.local/lib/python3.6/site-packages/sportsreference/ncaaf/schedule.py", line 159, in dataframe_extended
return self.boxscore.dataframe
File "/home/chris/.local/lib/python3.6/site-packages/sportsreference/ncaaf/boxscore.py", line 240, in dataframe
‘away_first_downs’: self.away_first_downs,
File "/home/chris/.local/lib/python3.6/site-packages/sportsreference/ncaaf/boxscore.py", line 374, in away_first_downs
return int(self._away_first_downs)
TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (5 by maintainers)
Yes, I was using the pip package. I don’t know exactly what year it was, but it was from between 2000 and 2017, so not 2018. Just from using this package a little bit this afternoon, I’ve noticed that there are occasional issues where missing data or incorrectly formatted data from Sports-Reference causes issues like this. (For example I ran into some incorrectly formatted dates)
Thank you soooo much by the way for working on the project. It looks promising to be immensely useful to aspiring data scientists/handicappers like me.
@ChrisHeneghan just FYI, I created v0.1.1 which is similar to #4 in that it fixes all of the issues I encountered with v0.1.0. The release is now up on PyPI and can be upgraded/re-installed to make use of the fixes. I will still keep #4 open for now in case you have any feedback.