Answering this question , some others and I were really mistaken in the belief that the following would work:
Let's say that he has
test = [ [ [0], 1 ], [ [1], 1 ] ] import numpy as np nptest = np.array(test)
What is the reason
>>> nptest[:,0]==[1] array([False, False], dtype=bool)
while
>>> nptest[0,0]==[1],nptest[1,0]==[1] (False, True)
or
>>> nptest==[1] array([[False, True], [False, True]], dtype=bool)
or
>>> nptest==1 array([[False, True], [False, True]], dtype=bool)
Is it a degeneration in size that causes it.
python numpy numpy-broadcasting
Kanak
source share