j-andrews7/kenpompy

Team names are incorrect when grabbing kenpom rankings

Closed this issue · 7 comments

when using kenpompy.misc.get_pomeroy_ratings names get cut off. For example there are three Cal St. when one should be Cal St. Fullerton, Cal St. Northridge etc.

All those juco California teams are the same. Thanks for the report. Regex woes strike again. We'll try to fix this for our start of season release.

See #9 and #41 for previous issues with this. #42 was our last fix for this, I believe.

No worries! There is a workaround using get valid team names, but just wanted to bring it to your attention!

esqew commented

I believe #42 did fix this since I can't repro this when using the latest commit:

from kenpompy.utils import login
browser = login('[redacted]', '[redacted]')

from kenpompy.misc import get_pomeroy_ratings
df = get_pomeroy_ratings(browser=browser)
df[df['Team'].str.startswith('Cal')]['Team']

Result:

145             California
173      Cal St. Fullerton
180            Cal Baptist
277    Cal St. Bakersfield
321     Cal St. Northridge
340               Cal Poly
Name: Team, dtype: object

If you're still using the version that's on PyPi (released 12-2022), that doesn't yet have this patch (01-2023). If this is something that you need fixed ASAP, you should install the latest from the master branch:

pip install git+git://github.com/j-andrews7/kenpompy@master

This may require you to uninstall the library entirely before reinstalling it from master as the version number hasn't yet been bumped in preparation for the next release.

Not specific to the California teams, but the team name grabbing is still not working exactly right. For example, both "South Carolina" and "South Carolina State" become "South Carolina." Can use conf to differentiate, but it's still a bit confusing. Alabama A&M gets stored as "Alabama A," Arkansas Pine Bluff is "Arkansas Pine," etc.

Thought I had updated kenpompy from git but evidently not. An uninstall and reinstall from git fixed it. Thanks!