-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
argwhere does not work with pandas Series #15555
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
Likely caused by me in #13610 |
This comment has been minimized.
This comment has been minimized.
I have just updated the issue with the full error message |
Also interestingly, it does not fail with Python 3.6.9 and numpy 1.18.1 but fails with Python 3.7.4 and numpy 1.18.1 |
My guess is your pandas version is different between the two python versions? |
I think this may be a pandas issue, and the error is probably correct. Note that I get:
with my default pandas+numpy version. So I doubt it was a change inside NumPy that caused the change in behaviour. Now... the whole thing comes down to |
yes, my pandas versions are 0.25.3 where it does not fail and 1.0.1 where it fails |
If the issue is in converting an array to a Series, it seems like a pandas issue. I can take a look into why they chose to deprecate |
The reason I think this is an issue (either for pandas or numpy) is that the user does not necessarily know that np.argwhere uses the |
Just for reference: I was not able to reproduce this bug with numpy 1.26 and pandas 2.1.1... maybe it is safe to close the issue. |
np.argwhere() does not work on a pandas series in v1.18.1, whereas it works in an older version v1.17.3. Also, np.where() works on a pandas series but np.argwhere() does not.
Reproducing code example:
Error message:
Numpy/Python version information:
1.18.1 3.7.4 (default, Aug 13 2019, 20:35:49)
The text was updated successfully, but these errors were encountered: