You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
after #13145 some RunTimeWarnings remain in the codebase. We should look at these and silence (using np.errstate), or fix if we are testing something odd. (running the full test suite will show these; I have extracted them, some are showing a level too low in the stack).
Also since 0.19.0 but still in current master: pandas/pandas/core/generic.py:5126: RuntimeWarning: invalid value encountered in absolutereturn np.abs(self)
In [1]: import numpy as np; import pandas as pd
In [2]: pd.__version__
Out[2]: '0.19.0+52.g096d886'
In [3]: pd.Series([1, -2.0, np.NaN]).abs()
C:\AnacondaBleeding\lib\site-packages\pandas\core\generic.py:5126: RuntimeWarning: invalid value encountered in absolute
return np.abs(self)
Out[3]:
0 1.0
1 2.0
2 NaN
dtype: float64
@Liam3851 you would have to show more information, e.g. pd.show_versions(). This has worked for quite a number of versions already as is not related this issue. more likely a numpy / platform version I think.
In [2]: pd.__version__
Out[2]: '0.19.0+53.g7f5a45c'
In [3]: pd.Series([1, -2.0, np.NaN]).abs()
Out[3]:
0 1.0
1 2.0
2 NaN
dtype: float64
In [4]: np.__version__
Out[4]: '1.11.2'
Odd. Do you see the error with raw numpy outside pandas?
In [1]: import numpy as np
In [2]: np.abs(np.array([1, -2, np.nan]))
C:\AnacondaBleeding\envs\pandas_dev\Scripts\ipython-script.py:1: RuntimeWarning: invalid value encountered in absolute
if __name__ == '__main__':
Out[2]: array([ 1., 2., nan])
NDFrame.abs is just calling np.abs(self). I can kill the warning by adding
Activity
jreback commentedon Aug 21, 2016
cc @rkern
Liam3851 commentedon Oct 28, 2016
Also since 0.19.0 but still in current master:
pandas/pandas/core/generic.py:5126: RuntimeWarning: invalid value encountered in absolutereturn np.abs(self)jreback commentedon Oct 29, 2016
@Liam3851 you would have to show more information, e.g.
pd.show_versions(). This has worked for quite a number of versions already as is not related this issue. more likely a numpy / platform version I think.Liam3851 commentedon Nov 1, 2016
Thanks Jeff. I'm still showing with numpy 1.11.2 on Windows 7. Here's pd.show_versions;
jreback commentedon Nov 1, 2016
can you step thru and see exactly where this is coming from? I cannot repro
Liam3851 commentedon Nov 1, 2016
Odd. Do you see the error with raw numpy outside pandas?
NDFrame.absis just calling np.abs(self). I can kill the warning by addingwith np.errstate(invalid='ignore'):before the
return np.abs(self)at line 5126.jreback commentedon Nov 1, 2016
actually I can repro only on 2.7 on windows. I think this is a numpy bug actually (if you'd like to search / report if its not there).
In any event, let's up a
np.errstatein pandas around in.abs()mroeschke commentedon May 1, 2021
I believe we took care of our warnings a while back so going to close this issue. Should open up separate newer issues if they still exist