Re: [Numpy-discussion] dumb question about creating a complex array

2007-02-22 Thread Mathew Yeates
Thanks for the replies. I think I have enough to work with. Mathew Christopher Barker wrote: > Mathew Yeates wrote: > >> given an array of floats, 2N columns and M rows, where the elements >> A[r,2*j] and A[r,2*j+1] form the real and imaginary parts of a complex >> number ... What is th

Re: [Numpy-discussion] dumb question about creating a complex array

2007-02-22 Thread Christopher Barker
Mathew Yeates wrote: > given an array of floats, 2N columns and M rows, where the elements > A[r,2*j] and A[r,2*j+1] form the real and imaginary parts of a complex > number ... What is the simplest way to create a complex array? It's > a fairly large array so I want to keep copying to a mini

Re: [Numpy-discussion] dumb question about creating a complex array

2007-02-22 Thread Stefan van der Walt
On Thu, Feb 22, 2007 at 02:50:16PM -0800, Mathew Yeates wrote: > given an array of floats, 2N columns and M rows, where the elements > A[r,2*j] and A[r,2*j+1] form the real and imaginary parts of a complex > number ... What is the simplest way to create a complex array? It's > a fairly large

Re: [Numpy-discussion] dumb question about creating a complex array

2007-02-22 Thread Stefan van der Walt
Hi Matthew On Thu, Feb 22, 2007 at 02:50:16PM -0800, Mathew Yeates wrote: > given an array of floats, 2N columns and M rows, where the elements > A[r,2*j] and A[r,2*j+1] form the real and imaginary parts of a complex > number ... What is the simplest way to create a complex array? It's > a

[Numpy-discussion] dumb question about creating a complex array

2007-02-22 Thread Mathew Yeates
given an array of floats, 2N columns and M rows, where the elements A[r,2*j] and A[r,2*j+1] form the real and imaginary parts of a complex number ... What is the simplest way to create a complex array? It's a fairly large array so I want to keep copying to a minimum. (Actually, it's not a f

Re: [Numpy-discussion] what goes wrong with cos(), sin()

2007-02-22 Thread David M. Cooke
On Feb 21, 2007, at 14:54 , Christopher Barker wrote: > Anne Archibald wrote: >> Or, to see more clearly, try taking (on a pocket calculator, say) >> sin(3.14) (or even sin(pi)). > > This is an interesting point. I took a class from William Kahan once > (pass/fail, thank god!), and one question he

Re: [Numpy-discussion] what goes wrong with cos(), sin()

2007-02-22 Thread Christopher Barker
David L Goldsmith wrote: > I agree w/ Chuck - I'd consider what Tim describes is happening a "bug". It's not a bug, but it is a missing feature. numpy doesn't appear to convert strings to numbers for any of its own types: >>> N.float128("4.3") Traceback (most recent call last): File "", line

Re: [Numpy-discussion] what goes wrong with cos(), sin()

2007-02-22 Thread David L Goldsmith
I agree w/ Chuck - I'd consider what Tim describes is happening a "bug". DG Charles R Harris wrote: > > > On 2/21/07, *Timothy Hochberg* <[EMAIL PROTECTED] > > wrote: > > > > On 2/21/07, *Charles R Harris* < [EMAIL PROTECTED] > > wrote:

Re: [Numpy-discussion] Managing Rolling Data

2007-02-22 Thread Alexander Michael
On 2/22/07, Sturla Molden <[EMAIL PROTECTED]> wrote: > A ring buffer is O(1) whereas a memmove is O(N). Unless the amount of > data to be moved are very small, this makes the ringbuffer the more > attractive solution. > > Slicing becomes a little bit more complicated with a ring, but not very > muc

Re: [Numpy-discussion] installation documentation

2007-02-22 Thread Toon Knapen
Travis Oliphant wrote: If you don't care about using "vendor-specific math libraries" then it's as easy as python setup.py install on linux and aix (it's also that easy on Windows if you have the right compiler and/or configuration file set up). If you care about vendor specific libraries,

Re: [Numpy-discussion] Managing Rolling Data

2007-02-22 Thread Sturla Molden
On 2/21/2007 11:03 PM, Anne Archibald wrote: > I think it is almost as efficient as memmove; in particular, it > doesn't create any temporaries A ring buffer is O(1) whereas a memmove is O(N). Unless the amount of data to be moved are very small, this makes the ringbuffer the more attractive s

Re: [Numpy-discussion] Managing Rolling Data

2007-02-22 Thread Robert Cimrman
Alexander Michael wrote: > I'm new to numpy and looking for advice on setting up and managing > array data for my particular problem. I'm collecting observations of P > properties for N objects over a rolling horizon of H sample times. I > could conceptually store the data in three-dimensional arra