update to numpy-1.5.0 gives new warnings from scipy
![](https://secure.gravatar.com/avatar/0b7d465c9e16b93623fd6926775b91eb.jpg?s=120&d=mm&r=g)
After update to numpy-1.5.0, I'm getting warnings from scipy. These probably come from my code using convolve. Does scipy need updating? /home/nbecker/.local/lib/python3.6/site-packages/scipy/fftpack/basic.py:160: 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. z[index] = x /home/nbecker/.local/lib/python3.6/site-packages/scipy/signal/signaltools.py:491: 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. return x[reverse].conj() /home/nbecker/.local/lib/python3.6/site-packages/scipy/signal/signaltools.py:251: 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. in1zpadded[sc] = in1.copy()
![](https://secure.gravatar.com/avatar/b4f6d4f8b501cb05fd054944a166a121.jpg?s=120&d=mm&r=g)
On Wed, 2018-07-25 at 07:44 -0400, Neal Becker wrote:
Probably yes, I am a bit surprised we did not notice it before if it is in scipy (or maybe scipy is already fixed?). This may be one of the more controversial new warnings, so lets see if it comes up more. Right now it seems not to affect much, I guess. If the correct thing to do is to use the list as an array, then the easiest solution maybe to do: z[index,] = x # note the additional `,` # or alternatively of course: z[np.asarray(index)] = x Otherwise, you will have to use `tuple(index)` to make sure numpy interprets it as a multi-dimensional index. The problem here, that this solves, is that if you have `z[some_list]` currently numpy basically guesses whether you want a multi-dimensional index or not. - Sebastian
![](https://secure.gravatar.com/avatar/b4f6d4f8b501cb05fd054944a166a121.jpg?s=120&d=mm&r=g)
On Wed, 2018-07-25 at 07:44 -0400, Neal Becker wrote:
Probably yes, I am a bit surprised we did not notice it before if it is in scipy (or maybe scipy is already fixed?). This may be one of the more controversial new warnings, so lets see if it comes up more. Right now it seems not to affect much, I guess. If the correct thing to do is to use the list as an array, then the easiest solution maybe to do: z[index,] = x # note the additional `,` # or alternatively of course: z[np.asarray(index)] = x Otherwise, you will have to use `tuple(index)` to make sure numpy interprets it as a multi-dimensional index. The problem here, that this solves, is that if you have `z[some_list]` currently numpy basically guesses whether you want a multi-dimensional index or not. - Sebastian
participants (3)
-
Neal Becker
-
Ralf Gommers
-
Sebastian Berg