-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Handle FutureWarning from NumPy in Series Construction #22698
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
Also want to look at |
The occurrences of that last one: pandas/pandas/core/arrays/datetimelike.py Lines 59 to 63 in d765dfb
pandas/pandas/core/arrays/integer.py Lines 508 to 512 in 857515f
pandas/pandas/core/indexes/base.py Lines 98 to 102 in d39249a
|
Looking through this again, I'm concerned I was overly-zealous in my filtering in #22699. In particular, the In [6]: pd.Index([1, 2]) == 'a'
/Users/taugspurger/sandbox/pandas/pandas/core/indexes/base.py:84: FutureWarning: elementwise comparison failed; returning scalar instead, but in the future will perform elementwise comparison
result = op(self.values, np.asarray(other))
Out[6]: False
In [7]: pd.Index([1, 2]) == 1
Out[7]: array([ True, False])
In [8]: pd.Index(['a', 'b']) == 'a'
Out[8]: array([ True, False])
In [9]: pd.Index(['a', 'b']) == 1
Out[9]: array([False, False]) Clearly `Out[6] is the odd one out, so we want NumPy's future behavior. I'm worried now that it'll change without warning, since NumPy was issuing the warnings but we caught them. How should we handle this? Is it as simple as not filtering those warnings? |
Though I think we're OK pushing this to 0.24.2 or 0.25, since NumPy just had a release. |
Closes pandas-dev#22698 Specifically, see pandas-dev#22698 (comment)
This is with NumPy dev.
https://travis-ci.org/pandas-dev/pandas/jobs/427640030#L5344
this goes from
core.series._sanitize_array
->_try_cast
->maybe_cast_to_integer_array
.The text was updated successfully, but these errors were encountered: