I have a NumPy array with a shape of (3,1,2)
:
A=np.array([[[1,4]],
[[2,5]],
[[3,2]]]).
I\'d like to ge
You can specify axis
as parameter to numpy.min
function.
In [10]: A=np.array([[[1,4]],
[[2,5]],
[[3,6]]])
In [11]: np.min(A)
Out[11]: 1
In [12]: np.min(A, axis=0)
Out[12]: array([[1, 4]])
In [13]: np.min(A, axis=1)
Out[13]:
array([[1, 4],
[2, 5],
[3, 6]])
In [14]: np.min(A, axis=2)
Out[14]:
array([[1],
[2],
[3]])