> |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
On Tue, Dec 13, 2011 at 22:11, Ken Basye 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 can't figure ou
On Tue, Dec 13, 2011 at 4:11 PM, Ken Basye 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 can't figure
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 = np.ar