>
> Would it be reasonable if argsort returned the complete tuple of
> indices, so that
> A[A.argsort(ax)] would work ?
+1
This is the behavior one would naturally expect.
Eric
-
Using Tomcat but need to do more? Need to
On 7/13/06, Travis Oliphant <[EMAIL PROTECTED]> wrote:
> Pau Gargallo wrote:
> > On 7/12/06, Victoria G. Laidler <[EMAIL PROTECTED]> wrote:
> >
> >> Hi,
> >>
> >> Pardon me if I'm reprising an earlier discussion, as I'm new to the list.
> >>
> >> But is there a reason that this obscure syntax
> >>
Pau Gargallo wrote:
> On 7/12/06, Victoria G. Laidler <[EMAIL PROTECTED]> wrote:
>
>> Hi,
>>
>> Pardon me if I'm reprising an earlier discussion, as I'm new to the list.
>>
>> But is there a reason that this obscure syntax
>>
>> A[arange(2)[:,newaxis],indexes]
>>
>> A[arange(A.shape[0])[:,newaxi
On 7/12/06, Victoria G. Laidler <[EMAIL PROTECTED]> wrote:
> Hi,
>
> Pardon me if I'm reprising an earlier discussion, as I'm new to the list.
>
> But is there a reason that this obscure syntax
>
> A[arange(2)[:,newaxis],indexes]
>
> A[arange(A.shape[0])[:,newaxis],indexes]
>
> is preferable to the
Hi,
Pardon me if I'm reprising an earlier discussion, as I'm new to the list.
But is there a reason that this obscure syntax
A[arange(2)[:,newaxis],indexes]
A[arange(A.shape[0])[:,newaxis],indexes]
is preferable to the intuitively reasonable thing that the Original
Poster did?
A[indexes]
On Tue, Jul 11, 2006 at 12:37:23PM +0200, Pau Gargallo wrote:
> > Something's not quite right here. The argsort docstring states that:
> >
> > argsort(a,axis=-1) return the indices into a of the sorted array
> > along the given axis, so that take(a,result,axis) is the sorted array.
> >
> >
On 7/11/06, Stefan van der Walt <[EMAIL PROTECTED]> wrote:
> On Tue, Jul 11, 2006 at 11:32:48AM +0200, Emanuele Olivetti wrote:
> > Hi,
> > I don't understand how to use argsort results. I have a 2D matrix and
> > I want to sort values in each row and obtain the index array of that
> > sorting. Arg
On Tue, Jul 11, 2006 at 11:32:48AM +0200, Emanuele Olivetti wrote:
> Hi,
> I don't understand how to use argsort results. I have a 2D matrix and
> I want to sort values in each row and obtain the index array of that
> sorting. Argsort(1) is what I need, but the problem is how to use its
> result in
Wow. I have to study much more indexing. It works pretty well.
Just to help indexing newbie like on using your advice:
A[arange(A.shape[0])[:,newaxis],indexes]
Thanks a lot!
Emanuele
Pau Gargallo wrote:
> here goes a first try:
>
> A[arange(2)[:,newaxis],indexes]
here goes a first try:
A[arange(2)[:,newaxis],indexes]
pau
On 7/11/06, Emanuele Olivetti <[EMAIL PROTECTED]> wrote:
> Hi,
> I don't understand how to use argsort results. I have a 2D matrix and
> I want to sort values in each row and obtain the index array of that
> sorting. Argsort(1) is what
Hi,
I don't understand how to use argsort results. I have a 2D matrix and
I want to sort values in each row and obtain the index array of that
sorting. Argsort(1) is what I need, but the problem is how to use its
result in order to obtain a sorted matrix. Here is the simple example:
A = array([[2,
11 matches
Mail list logo