|
>>> from numpy import *
>>> x = matrix([[1,1],[1,1]])
>>> y = matrix([[1,1],[1,1]])
>>> z = y[x]
>>> z
matrix([[[1, 1],
[1, 1]],
[[1, 1],
[1, 1]]])
>>> x = matrix([[2,2],[2,2]])
>>> z
matrix([[[1, 1],
[1, 1]],
[[1, 1],
[1, 1]]])
>>> y = matrix([[1,1],[1,1]])
>>> z = y[x]
Traceback (most recent call last):
File "<pyshell#14>", line 1, in <module>
z = y[x]
File "C:\Python\Python36\lib\site-packages\numpy\matrixlib\defmatrix.py", line 190, in __getitem__
out = N.ndarray.__getitem__(self, index)
IndexError: index 2 is out of bounds for axis 0 with size 2
>>> y = matrix([[2,2],[2,2]])
>>> x = matrix([[1,1],[1,1]])
>>> z = y[x]
>>> z
matrix([[[2, 2],
[2, 2]],
[[2, 2],
[2, 2]]])
>>>
|
|