j-andrews7 / kenpompy

A simple yet comprehensive web scraper for kenpom.com.
https://kenpompy.readthedocs.io/en/latest/?badge=latest
GNU General Public License v3.0
73 stars 21 forks source link

Team schedules pre-2011 #78

Closed jmislansky closed 1 year ago

jmislansky commented 1 year ago

When trying to pull any year between 2002 and 2010, you get the following error. Tried with multiple teams and I received the same error.

ValueError Traceback (most recent call last) Streaks/win_streaks.ipynb Cell 2 line 2 1 season = 2003 ----> 2 df = kp.get_schedule(browser, "Purdue", season=2002)

File [~/DataScience/ds/lib/python3.11/site-packages/kenpompy/team.py:99], in get_schedule(browser, team, season) [97] # Dataframe Tidying [98] schedule_df = schedule_df[0] ---> [99] schedule_df.columns = ['Date', 'Team Rank', 'Opponent Rank', 'Opponent Name', 'Result', 'Possession Number', [100] 'A', 'Location', 'Record', 'Conference', 'B'] [101] schedule_df = schedule_df.drop(columns = ['A', 'B']) [102] schedule_df = schedule_df.fillna('')`

j-andrews7 commented 1 year ago

This should be fixed by #75

jmislansky commented 1 year ago

Ah thank you, I had installed whatever version was on pypi, not the latest GitHub push

j-andrews7 commented 1 year ago

Just pushed a new release that should have the fixes for this as well.