-
Notifications
You must be signed in to change notification settings - Fork 50
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
07_04_random_forest in baseball_fantasy #1
Comments
Thanks for letting me know about this. I just updated the As for me, the line you reference: dfp = (pd.read_csv(path.join(DATA100, 'pitches.csv'))
.query("pitch_type.notnull() & pitch_type not in ('FO', 'PO')") works (I even copied and pasted what you had here), so not sure what's going on. Maybe try it with the updated |
Ok thanks
This is what I used instead and I believe it works
dfp = (pd.read_csv(path.join(DATA100, 'pitches.csv'))
.query("pitch_type not in ('FO', 'PO')"))
dfp = dfp.loc[dfp['pitch_type'].notnull()]
I am getting around 85-86 % when I run the test['correct'].mean()
…On Fri, 24 Dec 2021 at 05:26, Nathan Braun ***@***.***> wrote:
Thanks for letting me know about this. I just updated the DATA100
directory in that file to be more consistent with the rest of the files,
you can try grabbing them again.
As for me, the line you reference:
dfp = (pd.read_csv(path.join(DATA100, 'pitches.csv'))
.query("pitch_type.notnull() & pitch_type not in ('FO', 'PO')")
works (I even copied and pasted what you had here), so not sure what's
going on. Maybe try it with the updated DATA100 and let me know if it
still doesn't work?
—
Reply to this email directly, view it on GitHub
<#1 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AWMFOKRH4NIMU7XHRCJEGU3USRDGBANCNFSM5KQVKGDA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Sometimes you can also specify dfp = (pd.read_csv(path.join(DATA100, 'pitches.csv'))
.query("pitch_type.notnull() & pitch_type not in ('FO', 'PO')", engine='python') But glad it's working now. |
Hello, for the web scraping section, I feel like it only works for your
specific baseball-almanac webpage and not for anything else. Do you have
other examples of web scraping on other sites to make us understand more
the web scraping of various html setups of websites?
Thank you and have a good day
…On Fri, 24 Dec 2021 at 05:26, Nathan Braun ***@***.***> wrote:
Thanks for letting me know about this. I just updated the DATA100
directory in that file to be more consistent with the rest of the files,
you can try grabbing them again.
As for me, the line you reference:
dfp = (pd.read_csv(path.join(DATA100, 'pitches.csv'))
.query("pitch_type.notnull() & pitch_type not in ('FO', 'PO')")
works (I even copied and pasted what you had here), so not sure what's
going on. Maybe try it with the updated DATA100 and let me know if it
still doesn't work?
—
Reply to this email directly, view it on GitHub
<#1 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AWMFOKRH4NIMU7XHRCJEGU3USRDGBANCNFSM5KQVKGDA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Hello nathan,
in 07_04_random_forest, I am experiencing problems.
First of all, the DATA100 line does not take all the necessary directories into account. It is './data/100-game-sample/' instead of starting at the directory of Users/.
and, the line dfp = (pd.read_csv(path.join(DATA100, 'pitches.csv'))
.query("pitch_type.notnull() & pitch_type not in ('FO', 'PO')")) has an error to it: TypeError: unhashable type: 'numpy.ndarray'
I tried to fix it but I am no pro.
Wondering if you can tell me why it does not work like all the other files of every other chapter.
Great book by the way
The text was updated successfully, but these errors were encountered: