efiring wrote:
>
> On 05/14/2010 11:03 AM, Dr. Phillip M. Feldman wrote:
>>
> It is perfectly reasonable to have an algorithm that uses values
> sorted along
> the last axis, even if that dimension sometimes turns out to be one.
>
> Eric
>
Excellent point! I agree. Case closed.
Phillip
-
Chris Barker wrote:
> I can't find it right now, but I'm pretty sure there is a function that
> will re-shape an array to remove the length-1 dimensions -- maybe that's
> what the OP needs.
it's np.squeeze()
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOA
>> Second, treating a
>> unit dimension differently from a non-unit dimension *is* making it a
>> special case, and often--usually--one does not want that. It is
>> perfectly reasonable to have an algorithm that uses values sorted along
>> the last axis, even if that dimension sometimes turns out
On Fri, May 14, 2010 at 17:29, Eric Firing wrote:
> On 05/14/2010 11:03 AM, Dr. Phillip M. Feldman wrote:
>>
>> Robert Kern-2 wrote:
>>>
>>> On Wed, May 12, 2010 at 20:19, Dr. Phillip M. Feldman
>>> wrote:
When operating on an array whose last dimension is unity, the default
behav
On 05/14/2010 11:03 AM, Dr. Phillip M. Feldman wrote:
>
>
>
> Robert Kern-2 wrote:
>>
>> On Wed, May 12, 2010 at 20:19, Dr. Phillip M. Feldman
>> wrote:
>>>
>>> When operating on an array whose last dimension is unity, the default
>>> behavior of argsort is not very useful:
>>>
>>> |6> x=random.
Robert Kern-2 wrote:
>
> On Wed, May 12, 2010 at 20:19, Dr. Phillip M. Feldman
> wrote:
>>
>> When operating on an array whose last dimension is unity, the default
>> behavior of argsort is not very useful:
>>
>> |6> x=random.random((4,1))
>> |7> shape(x)
>> <7> (4, 1)
>>
On Wed, May 12, 2010 at 20:19, Dr. Phillip M. Feldman
wrote:
>
> When operating on an array whose last dimension is unity, the default
> behavior of argsort is not very useful:
>
> |6> x=random.random((4,1))
> |7> shape(x)
> <7> (4, 1)
> |8> argsort(x)
> <
When operating on an array whose last dimension is unity, the default
behavior of argsort is not very useful:
|6> x=random.random((4,1))
|7> shape(x)
<7> (4, 1)
|8> argsort(x)
<8>
array([[0],
[0],
[0],
[0]])
|9> argsort(x,axis=0)