-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
import_pfr_passing #50
Comments
Hey @bhibby, thanks for the callout! This looks like a documentation mistake - the Here is the docstring for the updated method:
|
thanks. I'm still not sure if RPO data is included? Doesnt show up in the column list |
I also pulled the pfr pass data for 2022 and the only game that shows up is the super bowl. |
I think the reason you're not seeing RPO data is because it is only present at the seasonal level on PFR, but not at the weekly level (which is what gets returned from this method when you specify years). If you just call I can definitely see how that is confusing if you're not actively looking at the PFR pages while using the method. We will discuss breaking these into separate |
This one is a known issue in our data source nflverse/nflverse-pfr#30. Hopefully that will get fixed soon. In the meantime, something like this can get the missing data per player. Just please make sure to respect PFR's server. # stat_type options: "passing", "rushing_and_receiving", "defense"
def scrape_pfr_advanced_2022(name, stat_type):
pfr_id = nfl.import_pfr("pass").loc[lambda x: x.player == name, "pfr_id"].iloc[0]
url = f"https://www.pro-football-reference.com/players/{pfr_id[0]}/{pfr_id}/gamelog/2022/advanced/"
table = pd.read_html(url, attrs={"id": f"advanced_{stat_type}"}, header=1)[0]
return table.iloc[:-1].rename(columns={"Rk": "Week", "Unnamed: 6": "At"}) |
Original documentation confusion resolved via #51. Missing 2022 data fixed with the resolution of nflverse/nflverse-pfr#30. Confusion around seasonal vs weekly PFR data to be addressed via #53. |
Hi, does this module work? I received an error: module 'nfl_data_py' has no attribute 'import_pfr_passing'.
looking for RPO info and I believe this has it?
thank you!
b
The text was updated successfully, but these errors were encountered: