Re: [Numpy-discussion] Getting indices from numpy array with condition

2008-11-18 Thread Robert Kern
On Wed, Nov 19, 2008 at 01:31, David Warde-Farley <[EMAIL PROTECTED]> wrote: > On 18-Nov-08, at 3:06 PM, Robert Kern wrote: > >> I like to discourage this use of where(). For some reason, back in >> Numeric's days, where() got stuck with two functionalities. nonzero() >> is the preferred function f

Re: [Numpy-discussion] Getting indices from numpy array with condition

2008-11-18 Thread David Warde-Farley
On 18-Nov-08, at 3:06 PM, Robert Kern wrote: > I like to discourage this use of where(). For some reason, back in > Numeric's days, where() got stuck with two functionalities. nonzero() > is the preferred function for this functionality. IMO, where(cond, > if_true, if_false) should be the only use

Re: [Numpy-discussion] Reduced row echelon form

2008-11-18 Thread jason-sage
Anne Archibald wrote: > 2008/11/18 Robert Young <[EMAIL PROTECTED]>: > > >> Is there a method in NumPy that reduces a matrix to it's reduced row echelon >> form? I'm brand new to both NumPy and linear algebra, and I'm not quite sure >> where to look. >> > > Unfortunately, reduced row-echelo

Re: [Numpy-discussion] Reduced row echelon form

2008-11-18 Thread Anne Archibald
2008/11/18 Robert Young <[EMAIL PROTECTED]>: > Is there a method in NumPy that reduces a matrix to it's reduced row echelon > form? I'm brand new to both NumPy and linear algebra, and I'm not quite sure > where to look. Unfortunately, reduced row-echelon form doesn't really work when using approx

Re: [Numpy-discussion] Reduced row echelon form

2008-11-18 Thread Robert Kern
On Tue, Nov 18, 2008 at 14:21, Robert Young <[EMAIL PROTECTED]> wrote: > Hi, > > Is there a method in NumPy that reduces a matrix to it's reduced row echelon > form? I'm brand new to both NumPy and linear algebra, and I'm not quite sure > where to look. No, we don't have a function to do that. Wha

Re: [Numpy-discussion] Fast and efficient way to convert an array into binary

2008-11-18 Thread Gregor Thalhammer
frank wang schrieb: > Hi, > > I have a large array and I want to convert it into a binary array. For > exampe, y=array([1,2,3]), after the convertion I want the result > array([0,0,0,1,0,0,1,0,0,0,1,1]). Each digit is converted into 4 bits > in this example. In my real problem I want to conver

[Numpy-discussion] Reduced row echelon form

2008-11-18 Thread Robert Young
Hi, Is there a method in NumPy that reduces a matrix to it's reduced row echelon form? I'm brand new to both NumPy and linear algebra, and I'm not quite sure where to look. Thanks Rob ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://p

[Numpy-discussion] Fast and efficient way to convert an array into binary

2008-11-18 Thread frank wang
Hi, I have a large array and I want to convert it into a binary array. For exampe, y=array([1,2,3]), after the convertion I want the result array([0,0,0,1,0,0,1,0,0,0,1,1]). Each digit is converted into 4 bits in this example. In my real problem I want to convert each digit to 8 bits. My data

Re: [Numpy-discussion] Getting indices from numpy array with condition

2008-11-18 Thread Robert Kern
On Tue, Nov 18, 2008 at 04:48, David Warde-Farley <[EMAIL PROTECTED]> wrote: > On 18-Nov-08, at 5:29 AM, Nicolas ROUX wrote: > >> Hi, >> >> Maybe this is not so clever, but I can't find it in the doc. >> I need to get all indices/index of all occurrences of a value in a >> numpy >> array >> >> >> A

Re: [Numpy-discussion] ANN: numpy.i - added managed deallocation to ARGOUTVIEW_ARRAY1 (ARGOUTVIEWM_ARRAY1)

2008-11-18 Thread Christopher Barker
Egor Zindy wrote: > I just finished coding all the ARGOUTVIEWM fragments in numpy.i and > wrote a wiki to explain what I did: > http://code.google.com/p/ezwidgets/wiki/NumpyManagedMemory thanks! good stuff. It would be great if you could put that in the numpy (scipy?) wiki though, so more folk

Re: [Numpy-discussion] ANN: numpy.i - added managed deallocation to ARGOUTVIEW_ARRAY1 (ARGOUTVIEWM_ARRAY1)

2008-11-18 Thread Egor Zindy
Hello list, I just finished coding all the ARGOUTVIEWM fragments in numpy.i and wrote a wiki to explain what I did: http://code.google.com/p/ezwidgets/wiki/NumpyManagedMemory No new information in there, but everything (explanations, links, code) is provided on a single page. Regards, Egor E

[Numpy-discussion] Fwd: fill() function does not work.

2008-11-18 Thread Frank Lagor
-- Forwarded message -- From: Matthieu Brucher <[EMAIL PROTECTED]> Date: Tue, Nov 18, 2008 at 1:36 PM Subject: Re: [Numpy-discussion] fill() function does not work. To: Discussion of Numerical Python >From the docstring: a.fill(value) -> None. Fill the array with the scalar valu

Re: [Numpy-discussion] fill() function does not work.

2008-11-18 Thread frank wang
Thanks for the quick reply. It is my fault to overlook the manual. Frank> Date: Tue, 18 Nov 2008 19:36:23 +0100> From: [EMAIL PROTECTED]> To: numpy-discussion@scipy.org> Subject: Re: [Numpy-discussion] fill() function does not work.> > >From the docstring:> > a.fill(value) -> None. Fill the

Re: [Numpy-discussion] fill() function does not work.

2008-11-18 Thread Matthieu Brucher
>From the docstring: a.fill(value) -> None. Fill the array with the scalar value. The method modifies the array, but does not return it. Matthieu 2008/11/18 frank wang <[EMAIL PROTECTED]>: > Hi, > > My numpy is 1.2.1 and python is 2.5.2. > > In python, I did: > > from numpy import * > x=array([

[Numpy-discussion] fill() function does not work.

2008-11-18 Thread frank wang
Hi, My numpy is 1.2.1 and python is 2.5.2. In python, I did: from numpy import * x=array([1,2,3]) z=x.fill(x) print z None z should be filled with zero. I do not knwo why I got None. Can anyone help me on this? Thanks Frank

Re: [Numpy-discussion] difference between ma.masked and ma.masked_array?

2008-11-18 Thread Pierre GM
All, ma.masked_array is a constructor function for ma.MaskedArray, like np.array is a constructor for np.ndarray. Its intended use is: a = ma.masked_array(yourdata, mask=yourmask, dtype=yourdtype) to which you can add the keyword arguments presented in the doc. ma.masked is a special constant u

Re: [Numpy-discussion] Getting indices from numpy array withcondition

2008-11-18 Thread Nicolas ROUX
Thanks ;-) It's pretty good, as I can apply it to any condition. Cheers, Nivolas. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Francesc Alted Sent: Tuesday, November 18, 2008 11:40 AM To: Discussion of Numerical Python Subject: Re: [Numpy-discussion

Re: [Numpy-discussion] Getting indices from numpy array with condition

2008-11-18 Thread David Warde-Farley
On 18-Nov-08, at 5:29 AM, Nicolas ROUX wrote: > Hi, > > Maybe this is not so clever, but I can't find it in the doc. > I need to get all indices/index of all occurrences of a value in a > numpy > array > > > As example: > > a = numpy.array([1,2,3],[4,5,6],[7,8,9]) > I need to get the indice/inde

Re: [Numpy-discussion] Missing numpy.i

2008-11-18 Thread Nicolas ROUX
Hi, About the missing doc directory in the windows install in latest numpy release, could you please add it ? (please see below the previous thread) Thanks, Cheers, Nicolas. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Stefan van der Walt Sent: Thurs

[Numpy-discussion] ANN: PyTables 2.1rc2 released

2008-11-18 Thread Francesc Alted
=== Announcing PyTables 2.1rc2 === PyTables is a library for managing hierarchical datasets and designed to efficiently cope with extremely large amounts of data with support for full 64-bit file addressing. PyTables runs on top of the HDF5 library

Re: [Numpy-discussion] Getting indices from numpy array with condition

2008-11-18 Thread Francesc Alted
A Tuesday 18 November 2008, Nicolas ROUX escrigué: > Hi, > > Maybe this is not so clever, but I can't find it in the doc. > I need to get all indices/index of all occurrences of a value in a > numpy array > > > As example: > > a = numpy.array([1,2,3],[4,5,6],[7,8,9]) > I need to get the indice/inde

[Numpy-discussion] Getting indices from numpy array with condition

2008-11-18 Thread Nicolas ROUX
Hi, Maybe this is not so clever, but I can't find it in the doc. I need to get all indices/index of all occurrences of a value in a numpy array As example: a = numpy.array([1,2,3],[4,5,6],[7,8,9]) I need to get the indice/index of all array elements where a[a>3] Any fast/easy way to write this