some warnings not being silenced #16306

Closed
dsm054 opened this Issue May 9, 2017 · 2 comments

Comments

Projects
None yet
4 participants
@dsm054
Contributor

dsm054 commented May 9, 2017

Some comparison operations seem to escape the silencing of numpy RuntimeWarnings. For example:

pd.DataFrame([0,0]).gt(pd.Series([0, np.nan]), axis=0)
pd.DataFrame([0,0]).lt(pd.Series([0, np.nan]), axis=0)
pd.DataFrame([0,0]).le(pd.Series([0, np.nan]), axis=0)
pd.DataFrame([0,0]).ge(pd.Series([0, np.nan]), axis=0)

all give

In [13]: pd.DataFrame([0,0]).gt(pd.Series([0, np.nan]), axis=0)
/home/dsm/sys/miniconda3/envs/36/lib/python3.6/site-packages/pandas/core/ops.py:1253: RuntimeWarning: invalid value encountered in greater
  result = op(x, y)

This is working with some timeseries data after some rolling operations, and so there are going to be lots of NaNs floating around. It'd be nice if I didn't need to suppress them myself.

Output of pd.show_versions()

``` In [19]: pd.show_versions() /home/dsm/sys/miniconda3/envs/36/lib/python3.6/site-packages/xarray/core/formatting.py:16: FutureWarning: The pandas.tslib module is deprecated and will be removed in a future version. from pandas.tslib import OutOfBoundsDatetime

INSTALLED VERSIONS

commit: None
python: 3.6.1.final.0
python-bits: 64
OS: Linux
OS-release: 4.4.0-77-generic
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_CA.UTF-8
LOCALE: en_CA.UTF-8

pandas: 0.20.1
pytest: 3.0.7
pip: 9.0.1
setuptools: 27.2.0
Cython: 0.25.2
numpy: 1.12.1
scipy: 0.19.0
xarray: 0.9.1
IPython: 5.3.0
sphinx: 1.5.1
patsy: 0.4.1
dateutil: 2.6.0
pytz: 2016.10
blosc: None
bottleneck: 1.2.0
tables: 3.3.0
numexpr: 2.6.2
feather: None
matplotlib: 2.0.0
openpyxl: 2.4.1
xlrd: 1.0.0
xlwt: 1.2.0
xlsxwriter: 0.9.6
lxml: 3.7.3
bs4: 4.5.3
html5lib: 0.999
sqlalchemy: 1.1.6
pymysql: None
psycopg2: None
jinja2: 2.9.5
s3fs: None
pandas_gbq: None
pandas_datareader: None

</details>
@chris-b1

This comment has been minimized.

Show comment
Hide comment
@chris-b1

chris-b1 May 9, 2017

Contributor

likely a symptom of #13145, we do some np.errstate wrapping on ops but apparently this case isn't

Contributor

chris-b1 commented May 9, 2017

likely a symptom of #13145, we do some np.errstate wrapping on ops but apparently this case isn't

@chris-b1 chris-b1 added this to the Next Major Release milestone May 9, 2017

@jorisvandenbossche

This comment has been minimized.

Show comment
Hide comment
@jorisvandenbossche

jorisvandenbossche May 9, 2017

Member

@dsm054 always welcome to look into it, if you are interested. pandas/core/ops.py is already sprinkled with with np.errstate(all='ignore'): 's, but apparently not for this case (I think it is https://github.com/pandas-dev/pandas/blob/master/pandas/core/ops.py#L1253).
But not fully sure how it was decided which op calls where wrapped and which not.

Member

jorisvandenbossche commented May 9, 2017

@dsm054 always welcome to look into it, if you are interested. pandas/core/ops.py is already sprinkled with with np.errstate(all='ignore'): 's, but apparently not for this case (I think it is https://github.com/pandas-dev/pandas/blob/master/pandas/core/ops.py#L1253).
But not fully sure how it was decided which op calls where wrapped and which not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment