-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Fix NumPy FutureWarning for non-tuple indexing. #11862
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
Conversation
lib/matplotlib/mlab.py
Outdated
@@ -392,7 +392,7 @@ def detrend_mean(x, axis=None): | |||
|
|||
ind = [slice(None)] * x.ndim | |||
ind[axis] = np.newaxis | |||
return x - x.mean(axis)[ind] | |||
return x - x.mean(axis)[tuple(ind)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just replace the whole function with x - x.mean(axis, keepdims=True)
?
This fixes the warning: .../matplotlib/mlab.py:395: FutureWarning: Using a non-tuple sequence for multidimensional indexing is deprecated; use `arr[tuple(seq)]` instead of `arr[seq]`. In the future this will be interpreted as an array index, `arr[np.array(seq)]`, which will result either in an error or a different result.
The CI errors were just an install burp on CircleCI's part |
@meeseeksdev backport to v3.0.x |
Something went wrong ... Please have a look at my logs. |
Mr Meeseeks saw the |
@meeseeksdev backport to v3.0.x |
Thanks @Carreau ! BTW, Mr Meeseeks is great! I have no idea how it works, but it sure makes back porting easy. I particularly like the recent change where it tells us how to cherry-pick. |
The code is ugly but available there with regular updates. In a nutshell, You can create a GitHub Application, and if a repo is enabled for this application github delivers all events on the repo to me. Then you "just" need to triage those and react accordingly. I'm going to see if I can check that branch exists and post a useful message instead of just failling. If you have any improvement, send a pull-request and when merged, it will auto-deploy on heroku. You can see minimal statistics here, but I want to make sure there is no sensitive data. The logs seem to be clean as well, but these I don't want to share, because those have private info. |
…862-on-v3.0.x Backport PR #11862 on branch v3.0.x
PR Summary
This fixes the warning:
PR Checklist