Shailendra gmail.com> writes:
>
> Well, this is just a toy problem. argmax represent a method which will
> give me a index in x[cond] . And for the case of multiple value my
> requirement is fine with getting any "max" index.
OK. My concern seems to be needless then.
BTW, does this current th
Well, this is just a toy problem. argmax represent a method which will
give me a index in x[cond] . And for the case of multiple value my
requirement is fine with getting any "max" index.
Thanks,
Shailendra
On Fri, Apr 2, 2010 at 3:00 PM, eat wrote:
> Shailendra gmail.com> writes:
>
>>
>> I fo
Shailendra gmail.com> writes:
>
> I forgot to mention that i wanted this to work for general shape. So i
> modified it little bit
>
> >>> x = array([[1,2,3,4,5], [6,7,8,7,6], [1,2,3,4,5]])
> >>> cond = (x > 5)
> >>> loc= where(cond)
> >>> arg_max=argmax(x[cond])
> >>> x[tuple([e[arg_max] for e
I forgot to mention that i wanted this to work for general shape. So i
modified it little bit
>>> x = array([[1,2,3,4,5], [6,7,8,7,6], [1,2,3,4,5]])
>>> cond = (x > 5)
>>> loc= where(cond)
>>> arg_max=argmax(x[cond])
>>> x[tuple([e[arg_max] for e in loc])]
8
Thanks for your solution.
Shailendra
On Fri, Apr 2, 2010 at 09:31, Shailendra wrote:
> Hi All,
> I have a following model problem. Let i have a array
x
> array([[1, 2, 3, 4, 5],
> [6, 7, 8, 7, 6],
> [1, 2, 3, 4, 5]])
>
> suppose i apply some cond on it.
cond= x>5
x[cond]
> array([6, 7, 8, 7, 6])
>
> Now, i
Hi All,
I have a following model problem. Let i have a array
>>> x
array([[1, 2, 3, 4, 5],
[6, 7, 8, 7, 6],
[1, 2, 3, 4, 5]])
suppose i apply some cond on it.
>>> cond= x>5
>>> x[cond]
array([6, 7, 8, 7, 6])
Now, i want to argmax on this
>>> max=argmax(x[cond])
>>> max
2
>>> x[cond]