On Thursday 06 August 2009 17:27:51 Robert Kern wrote:
> 2009/8/6 Hans Meine :
> > On Wednesday 05 August 2009 22:06:03 David Goldsmith wrote:
> >> But you can "cheat" and put them on one line (if that's all you're
after):
> >> >>> x = np.array([1, 2, 3])
> >> >>> maxi = x.argmax(); maxv = x[maxi]
2009/8/6 Hans Meine :
> On Wednesday 05 August 2009 22:06:03 David Goldsmith wrote:
>> But you can "cheat" and put them on one line (if that's all you're after):
>> >>> x = np.array([1, 2, 3])
>> >>> maxi = x.argmax(); maxv = x[maxi]
>
> Is there any reason not to put this as a convenience function
On Wednesday 05 August 2009 22:06:03 David Goldsmith wrote:
> But you can "cheat" and put them on one line (if that's all you're after):
> >>> x = np.array([1, 2, 3])
> >>> maxi = x.argmax(); maxv = x[maxi]
Is there any reason not to put this as a convenience function into numpy?
It is needed so f
But you can "cheat" and put them on one line (if that's all you're after):
>>> x = np.array([1, 2, 3])
>>> maxi = x.argmax(); maxv = x[maxi]
>>> maxi, maxv
(2, 3)
DG
--- On Wed, 8/5/09, Robert Kern wrote:
> From: Robert Kern
> Subject: R
On Wed, Aug 5, 2009 at 14:57, Dr. Phillip M.
Feldman wrote:
>
> With Python/NumPy, is there a way to get the maximum element of an array and
> also the index of the element having that value, at a single shot?
Not in one shot.
maxi = x.argmax()
maxv = x[maxi]
--
Robert Kern
"I have come to bel
With Python/NumPy, is there a way to get the maximum element of an array and
also the index of the element having that value, at a single shot? (One can
do this in Matlab via a statement like the following:
[x_max,ndx]= max(x)
--
View this message in context:
http://www.nabble.com/maximum-valu