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
70 stars 21 forks source link

Team schedules pre-2011 #78

Closed jmislansky closed 9 months ago

jmislansky commented 9 months 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 9 months ago

This should be fixed by #75

jmislansky commented 9 months ago

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

j-andrews7 commented 9 months ago

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