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

Add postseason indicator for team schedule (closes #80) #83

Closed esqew closed 12 months ago

WakeUpWaffles commented 12 months ago

Might be useful to have the name of the tournament instead of a boolean. Like "Big West Conference Tournament" to "Big West" and "NCAA Tournament - 14 seed" to NCAA. Non-tournament games could be left blank in the column

esqew commented 12 months ago

Might be useful to have the name of the tournament instead of a boolean. Like "Big West Conference Tournament" to "Big West" and "NCAA Tournament - 14 seed" to NCAA. Non-tournament games could be left blank in the column

I think you're right. Let me see if I can rework this slightly to include that info.

esqew commented 12 months ago

@WakeUpWaffles I added d7ca956 which now includes functionality to pull the name of the tournament. As an example:

from kenpompy.team import get_schedule
df = get_schedule(browser, team="Villanova", season = '2018')
df = df[~df['Postseason'].isnull()][['Date', 'Opponent Name', 'Result', 'Postseason']]
display(df)

This yields:

Date Opponent Name Result Postseason
31 Thu Mar 8 Marquette W, 94-70 Big East
32 Fri Mar 9 Butler W, 87-68 Big East
33 Sat Mar 10 Providence W, 76-66 Big East
34 Thu Mar 15 Radford W, 87-61 NCAA
35 Sat Mar 17 Alabama W, 81-58 NCAA
36 Fri Mar 23 West Virginia W, 90-78 NCAA
37 Sun Mar 25 Texas Tech W, 71-59 NCAA
38 Sat Mar 31 Kansas W, 95-79 NCAA
39 Mon Apr 2 Michigan W, 79-62 NCAA