-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
Deprecation warning when comparing a np.datetime64 scalar with a scalar #13548
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
We have to dig out this deprecation again some time I guess. This would be a type error for array comparison I suppose. So it could be argued that returning an array of False would be the correct thing to do (instead of an error, which would happen for example on shape mismatches). There are probably some issues like that where we are giving spurious DeprecationWarnings in equality right now :/ |
@seberg - just to check, is it safe to ignore this deprecation warning or is it likely that comparisons for scalars as above will actually error one day? |
Hmmm, since Python normally defines such comparisons, my guess is we should actually return false here. The question is whether we should go to an array-of-False in most cases. The other question (maybe more interesting), is whether we should do so by defining it for specific types in the I think I like the idea of just assuming inequality initially (this should maybe translate to the This might actually be a way forward to finally fix this damn warning, so thanks for the ping, it is a problem that has been bugging me for a long time and this gives me an excuse to spend time on it :) |
Ran into a similar case |
Finally fixed in gh-22707. |
Comparing a scalar
datetime64
currently returns a deprecation warning that I think should only apply to arrays:This is making it difficult to identify in large code bases which comparison actually need to be fixed.
Numpy 1.16.3
Python 3.7.3 (default, Apr 3 2019, 05:39:12) [GCC 8.3.0]
The text was updated successfully, but these errors were encountered: