Skip to content

Output shown doesn't match actual output #79

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

Closed
cgeroux opened this issue Aug 17, 2016 · 3 comments
Closed

Output shown doesn't match actual output #79

cgeroux opened this issue Aug 17, 2016 · 3 comments

Comments

@cgeroux
Copy link
Contributor

cgeroux commented Aug 17, 2016

When using the command

surveys_df['weight'].describe()

I get the output:

C:\Users\cgeroux\Anaconda3\lib\site-packages\numpy\lib\function_base.py:3834: RuntimeWarning: Invalid value encountered in percentile
  RuntimeWarning)
count    32283.000000
mean        42.672428
std         36.631259
min          4.000000
25%               NaN
50%               NaN
75%               NaN
max        280.000000
Name: weight, dtype: float64

Not what is shown in 01-starting-with-data of

count    32283.000000
mean        42.672428
std         36.631259
min          4.000000
25%         20.000000
50%         37.000000
75%         48.000000
max        280.000000
Name: weight, dtype: float64

These NaNs can be removed and the output from the current lesson can be produced with

surveys_df['weight'][surveys_df['weight'].notnull()].describe()

Not sure if this behavior depends on the version of pandas, python, or anaconda:

import sys
import pandas
print(sys.version)
print(pandas.__version__)

produces:

3.5.2 |Anaconda 4.1.1 (64-bit)| (default, Jul  5 2016, 11:41:13) [MSC v.1900 64 bit (AMD64)]
0.18.1
@ostueker
Copy link
Contributor

@cgeroux : This seems to be a known bug in pandas and has been fixed in the development version.
see: pandas-dev/pandas#13744

For this lesson the percentiles are not used for anything, so I don't think there is a need to change the DC material. (Though I admit the error messages that I get are somehow distracting).

@philippbayer
Copy link

I've run into this issue today but the fix has made it out of development and into release, after pip install -U pandas 0.19.0 shows the expected behaviour again so I think this issue can be closed (or maybe add a note for those still using 0.18.1? I expect to see this pop up in the workshop tomorrow)

@qjcg
Copy link
Contributor

qjcg commented Oct 24, 2016

Thanks for pointing this out @cgeroux and for the follow-up @ostueker and @philippbayer.

Closing this issue, as learners following our current setup instructions will end up installing pandas >= 0.19.0, and so will not encounter the bug.

@qjcg qjcg closed this as completed Oct 24, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants