Skip to content

some warnings not being silenced #16306

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
dsm054 opened this issue May 9, 2017 · 2 comments · Fixed by #16433
Closed

some warnings not being silenced #16306

dsm054 opened this issue May 9, 2017 · 2 comments · Fixed by #16433
Labels
Error Reporting Incorrect or improved errors from pandas
Milestone

Comments

@dsm054
Copy link
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
Copy link
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 the Error Reporting Incorrect or improved errors from pandas label May 9, 2017
@chris-b1 chris-b1 added this to the Next Major Release milestone May 9, 2017
@jorisvandenbossche
Copy link
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Error Reporting Incorrect or improved errors from pandas
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants