Skip to content

Unhandled warning from NumPy dev in median #22712

Closed
@TomAugspurger

Description

@TomAugspurger
In [1]: import pandas as pd

In [2]: import numpy as np

In [3]: x = np.random.randn(30, 4)

In [4]: x[5:10] = np.nan

In [5]: pd.DataFrame(x).median(1).head()
/Users/taugspurger/miniconda3/envs/travis-37-numpydev/lib/python3.7/site-packages/numpy/lib/function_base.py:3267: RuntimeWarning: All-NaN slice encountered
  r = func(a, **kwargs)
Out[5]:
0   -0.602415
1   -0.118699
2    0.744368
3   -0.993376
4   -0.304693
dtype: float64

In [6]: np.__version__
Out[6]: '1.16.0.dev0+88cbd3d'

Do we want to silence these?

Working around this in #22699

Metadata

Metadata

Assignees

No one assigned

    Labels

    Compatpandas objects compatability with Numpy or Python functionsDependenciesRequired and optional dependencies

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions