-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Deprecation/FutureWarnings raised by ==
on NumPy arrays in NumPy version1.9
#8537
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
Comments
Above, |
@jreback: I think this problem would be a lot easier to fix if in future versions of NumPy,
False is what it returns now, so I think the majority of those DeprecationWarnings would be moot. Meanwhile, the FutureWarnings (I think -- I should check this some more --) only occur when comparing NaNs in object arrays. We (hopefully) already address this issue with things like isnull and array_equivalent, so again the FutureWarnings should be moot. What do you think? Do you think we should ask the NumPy developers to change the TypeErrors to False? |
why don't u post a numpy issue and see why they are doing it this way I agree it would be more consistent to simply return FAlse |
@jreback: NumPy issue: numpy/numpy#5188 (comment) |
This continues a discussion started at the end of GH 8512
Summary: NumPy is changing the behavior of
==
. It no longer checks foris
relationships between elements. Therefore,In older versions of NumPy:
In future NumPy, I think this will happen:
In current NumPy version 1.9, a DeprecationWarning or FutureWarning is issued.
One place where this issue affects Pandas is
nosetests -v pandas/tests/test_series.py:TestSeries.test_replace
The problem originates in internals.py/_possibly_compare which is called like this:
Both of these raise DeprecationWarnings.
a
is always an array,b
is a scalar. AFAICT, the intent of_possibly_compare
is to return a boolean mask where elements ina
equalb
.Since we want a boolean mask,
array_equivalent
is not a help here since thatjust returns a single bool.
The text was updated successfully, but these errors were encountered: