Skip to content

DataFrame.describe can't return percentiles when data set contain nan #13118

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
tade0726 opened this issue May 9, 2016 · 3 comments
Closed
Labels
Duplicate Report Duplicate issue or pull request

Comments

@tade0726
Copy link

tade0726 commented May 9, 2016

Code Sample, a copy-pastable example if possible

des_table = df_final_S1415.describe(percentiles=[.05, .25, .5, .75, .95 ]).T

Expected Output

In version 18.0 describe function will return percentiles when columns contain nan.

output of pd.show_versions()

But in version 18.1 describe function will not return percentiles when columns contain nan.

@jorisvandenbossche
Copy link
Member

@tade0726 Can you please show a reproducible example? (some code that constructs a dataframe that shows the problem)

@jorisvandenbossche jorisvandenbossche added the Needs Info Clarification about behavior needed to assess issue label May 9, 2016
@jorisvandenbossche
Copy link
Member

Here is a reproducible example (the actual issue is in the quantile method):

In [24]: s = pd.Series(range(5))

In [25]: s.quantile(0.5)
Out[25]: 2.0

In [26]: s[0] = np.nan

In [27]: s.quantile(0.5)
Out[27]: nan

In [28]: pd.__version__
Out[28]: '0.18.1+20.gaf7bdd3'

@jorisvandenbossche
Copy link
Member

And it is a duplicate of #13098

Thanks for reporting

@jorisvandenbossche jorisvandenbossche added Duplicate Report Duplicate issue or pull request and removed Needs Info Clarification about behavior needed to assess issue labels May 9, 2016
@jorisvandenbossche jorisvandenbossche added this to the No action milestone May 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate Report Duplicate issue or pull request
Projects
None yet
Development

No branches or pull requests

2 participants