Skip to content

RuntimeWarning: Invalid value encountered in percentile RuntimeWarning #14328

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
piyush-jhawar opened this issue Oct 1, 2016 · 2 comments
Closed
Labels
Duplicate Report Duplicate issue or pull request Missing-data np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate

Comments

@piyush-jhawar
Copy link

piyush-jhawar commented Oct 1, 2016

A small, complete example of the issue

I am Using Pycharm
PyCharm Community Edition 2016.2.3
Build #PC-162.1967.10, built on September 7, 2016
JRE: 1.8.0_112-release-b343 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o

arr = np.array([[1,2,np.nan],[np.nan,3,4]])
dframe1 = DataFrame(arr,index=['A','B'],columns=['One','Two','Three'])
print dframe1.describe()

When I run .describe function it throws me an exception

 .../anaconda/lib/python2.7/site-packages/numpy/lib/function_base.py:3834: RuntimeWarning: Invalid value encountered in percentile
  RuntimeWarning)
       One       Two  Three
count  1.0  2.000000    1.0
mean   1.0  2.500000    4.0
std    NaN  0.707107    NaN
min    1.0  2.000000    4.0
25%    NaN  2.250000    NaN
50%    NaN  2.500000    NaN
75%    NaN  2.750000    NaN
max    1.0  3.000000    4.0

Expected Output

       One       Two  Three
count  1.0  2.000000    1.0
mean   1.0  2.500000    4.0
std    NaN  0.707107    NaN
min    1.0  2.000000    4.0
25%    NaN  2.250000    NaN
50%    NaN  2.500000    NaN
75%    NaN  2.750000    NaN
max    1.0  3.000000    4.0

Output of pd.show_versions()

# Paste the output here
@TomAugspurger
Copy link
Contributor

TomAugspurger commented Oct 1, 2016

What version of pandas, numpy, etc are you using? Paste the output of pd.show_versions

@jorisvandenbossche
Copy link
Member

This was an issue in 0.18.0/0.18.1 (#13098), and is solved in master (and will be in the upcoming 0.19.0 (will be releases in one of the coming days)).

@jorisvandenbossche jorisvandenbossche added Missing-data np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate Duplicate Report Duplicate issue or pull request labels Oct 1, 2016
@jorisvandenbossche jorisvandenbossche added this to the No action milestone Oct 1, 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 Missing-data np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate
Projects
None yet
Development

No branches or pull requests

3 participants