In [99]: D=np.array([[1, 1, 8, 8],
...: [3, 3, 4, 4],
...: [8, 8, 1, 1]])
In [100]: amin = D.argmin(0)
In [101]: amin
Out[101]: array([0, 0, 2, 2])
What is amin? It has one value per column, but that value is a row index. So what you want is:
In [102]: D[amin[0], 0]
Out[102]: 1
In [103]: D[amin[2], 2]
Out[103]: 1
Or doing all columns at once:
In [104]: D[amin, [0,1,2,3]]
Out[104]: array([1, 1, 1, 1])
Expressions like D[:, amin] try to apply amin to indexing the columns, not the rows. And the slice selects all rows at once. It doesn't pair them up.
May be these versions will make the action clearer:
In [105]: D[[0,0,2,2], [0,1,2,3]]
Out[105]: array([1, 1, 1, 1])
In [106]: [D[i,j] for i,j in zip([0,0,2,2],[0,1,2,3])]
Out[106]: [1, 1, 1, 1]
take_along_axis does the same thing as [104]
In [107]: np.take_along_axis(D, amin[None,:],0)
Out[107]: array([[1, 1, 1, 1]])
It's a bit cleaner if we tell argmin to keepdims (a new feature in v 1.22)
In [108]: amin = D.argmin(0, keepdims=True)
In [109]: amin
Out[109]: array([[0, 0, 2, 2]])
In [110]: np.take_along_axis(D, amin,0)
Out[110]: array([[1, 1, 1, 1]])
[1, 1, 1, 1]np.min(myArray, axis=0)(where np comes from doingimport numpy as np)aminD[amin, np.arange(len(amin))], IIUC.