2008/6/18 Charles R Harris <[EMAIL PROTECTED]>:
>
>
> On Wed, Jun 18, 2008 at 11:48 AM, Anne Archibald <[EMAIL PROTECTED]>
> wrote:
>>
>> 2008/6/18 Stéfan van der Walt <[EMAIL PROTECTED]>:
>> > 2008/6/18 Anne Archibald <[EMAIL PROTECTED]>:
>> >> In [7]: x.take(x.argsort())
>> >> Out[7]: array([ 0.
On Wed, Jun 18, 2008 at 11:48 AM, Anne Archibald <[EMAIL PROTECTED]>
wrote:
> 2008/6/18 Stéfan van der Walt <[EMAIL PROTECTED]>:
> > 2008/6/18 Anne Archibald <[EMAIL PROTECTED]>:
> >> In [7]: x.take(x.argsort())
> >> Out[7]: array([ 0. , 0.1, 0.2, 0.3])
> >>
> >> If you would like to think of i
2008/6/18 Stéfan van der Walt <[EMAIL PROTECTED]>:
> 2008/6/18 Anne Archibald <[EMAIL PROTECTED]>:
>> In [7]: x.take(x.argsort())
>> Out[7]: array([ 0. , 0.1, 0.2, 0.3])
>>
>> If you would like to think of it more mathematically, when you feed
>> np.argsort() an array that represents a permutati
On Wed, Jun 18, 2008 at 10:53 AM, Stéfan van der Walt <[EMAIL PROTECTED]>
wrote:
> 2008/6/18 Anne Archibald <[EMAIL PROTECTED]>:
> > In [7]: x.take(x.argsort())
> > Out[7]: array([ 0. , 0.1, 0.2, 0.3])
> >
> > If you would like to think of it more mathematically, when you feed
> > np.argsort()
Thanks, Anne. I misinterpreted what argsort() provides. I was
thinking about it in terms of the kind of behaviour exhibited by
searchsorted(). --Tom
--
On 18-Jun-08, at 12:10 PM, Anne Archibald wrote:
> 2008/6/18 Thomas J. Duck <[EMAIL PROTECTED]>:
>
>> I have found what I
2008/6/18 Anne Archibald <[EMAIL PROTECTED]>:
> In [7]: x.take(x.argsort())
> Out[7]: array([ 0. , 0.1, 0.2, 0.3])
>
> If you would like to think of it more mathematically, when you feed
> np.argsort() an array that represents a permutation of the numbers
> 0,1,...,n-1, you get back the inverse
2008/6/18 Thomas J. Duck <[EMAIL PROTECTED]>:
> I have found what I think is some strange behavior for argsort
> () and take(). First, here is an example that works as expected:
>
> >>> x = numpy.array([1,0,3,2])
> >>> x.argsort()
> array([1, 0, 3, 2])
>
> argsort() returns th
Hi,
I have found what I think is some strange behavior for argsort
() and take(). First, here is an example that works as expected:
>>> x = numpy.array([1,0,3,2])
>>> x.argsort()
array([1, 0, 3, 2])
argsort() returns the original array, which is self-indexing for
numb