Skip to content
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

Merging Pbp and Shifts Data #15

Open
HarryShomer opened this issue Nov 26, 2019 · 4 comments
Open

Merging Pbp and Shifts Data #15

HarryShomer opened this issue Nov 26, 2019 · 4 comments

Comments

@HarryShomer
Copy link
Owner

Some people were discussing this topic on twitter today and I had this lying around so I figured I may as well push it. The idea here is to combine the pbp and shifts into one DataFrame for ease of use. As of right now this only lives on my dev branch.

Here is how it works:

import hockey_scraper as hs

data = hs.scrape_games([2019020001, 2019020003, 2019020003], True, data_format='pandas')
merged_data = hs.utils.merge(data['pbp'], data['shifts'])

I've written this over a year ago and haven't really tested it too well so use at your own risk. The code could likely be cleaned up as well. If you use it let me know how it works. If you find any issues please let me know (in this thread) or feel free to open a merge request.

@delara38
Copy link

It tells me that there is no merge:
"AttributeError: module 'hockey_scraper.utils' has no attribute 'merge'"

@HarryShomer
Copy link
Owner Author

HarryShomer commented Mar 17, 2020

Hi @delara38 ,

The reason why was because I accidentally uncommented the import statement in the hs.utils._init_.py file. I just added it back in and pushed the commit to master. Thanks for the heads up!

Regards,
Harry

@delara38
Copy link

Would you be willing to update the pypi version to also contain this so I could also use the feature in google colab/jupyter notebooks.

Really appreciate the entire package already.
Thanks,
Nathan

@HarryShomer
Copy link
Owner Author

HarryShomer commented Mar 27, 2020

Hey @delara38,

Sorry, I must have missed your last comment.

I just updated it on pypi. I do want to be clear though that this is an experimental feature that I can't vouch for. So I guess use at your own risk.

Regards,
Harry

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants