Re: [Numpy-discussion] Array min from argmin along an axis?

2011-12-16 Thread Torgil Svensson
|6 y[np.argmin(y, axis=0), np.arange(y.shape[1])] array([0, 0, 0, 0, 0]) Can xrange in this case save me from creating a temporary array here or doesn't it matter? |6 y[np.argmin(y, axis=0), xrange(y.shape[1])] array([0, 0, 0, 0, 0]) //Torgil On Tue, Dec 13, 2011 at 11:27 PM, Robert Kern

[Numpy-discussion] Array min from argmin along an axis?

2011-12-13 Thread Ken Basye
Hi folks, I need an efficient way to get both the min and argmin of a 2-d array along one axis. It seemed to me that the way to do this was to get the argmin and then use it to index into the array to get the min, but I can't figure out how to do it. Here's my toy example: x =

Re: [Numpy-discussion] Array min from argmin along an axis?

2011-12-13 Thread Warren Weckesser
On Tue, Dec 13, 2011 at 4:11 PM, Ken Basye kbas...@jhu.edu wrote: Hi folks, I need an efficient way to get both the min and argmin of a 2-d array along one axis. It seemed to me that the way to do this was to get the argmin and then use it to index into the array to get the min, but I

Re: [Numpy-discussion] Array min from argmin along an axis?

2011-12-13 Thread Robert Kern
On Tue, Dec 13, 2011 at 22:11, Ken Basye kbas...@jhu.edu wrote: Hi folks,     I need an efficient way to get both the min and argmin of a 2-d array along one axis.  It seemed to me that the way to do this was to get the argmin and then use it to index into the array to get the min, but I