Python 3.5: numpy - how to avoid obsolete technology

I'm just starting to learn how to program in Python, and I get an error message that I don't understand:

DeprecationWarning: converting an array with ndim > 0 to an index will  
result in an error in the future  
value_could_be[i0:i1, j0:j1, k] = 0

value_could_be is a 9*9*9 numpy.ndarrayintegers.
i0, i1, j0, j1, kare all integers, presumably valid as indices, since the code works the way I want.

value_could_be[i, :, k] = 0  

does not generate the same warning

How do I code this to be future proof?

I am running numpy 1.10.1, python 3.5, spyder 2.3.7, anaconda 2.2.0 (originally installed with python 2.7 and python 3.5 added later). Everything works under OSX Mountain Lion.

When I post a Google message, I find links to "theano", but as far as I know, I do not use it. I also do not want to just suppress the message.

+4

Source: https://habr.com/ru/post/1618638/


All Articles