8000 Fix NumPy FutureWarning for non-tuple indexing. · matplotlib/matplotlib@ea8c13e · GitHub
[go: up one dir, main page]

Skip to content

Commit ea8c13e

Browse files
committed
Fix NumPy FutureWarning for non-tuple indexing.
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.
1 parent 8a8c881 commit ea8c13e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/matplotlib/mlab.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ def detrend_mean(x, axis=None):
392392

393393
ind = [slice(None)] * x.ndim
394394
ind[axis] = np.newaxis
395-
return x - x.mean(axis)[ind]
395+
return x - x.mean(axis)[tuple(ind)]
396396

397397

398398
def detrend_none(x, axis=None):

0 commit comments

Comments
 (0)
0