Re: [Numpy-discussion] [Repost] Adding the arrays returned in an array iterator

2011-06-03 Thread srean
> If they are in a list, then I would do something like Apologies if it wasnt clear in my previous mail. The arrays are in a lazy iterator, they are non-contiguous and there are several thousands of them. I was hoping there was a way to get at a "+=" operator for arrays to use in a reduce. Seems l

Re: [Numpy-discussion] loadtxt ndmin option

2011-06-03 Thread cgraves
Derek Homeier wrote: > > Hi Chris, > > On 31 May 2011, at 13:56, cgraves wrote: > >> I've downloaded the latest numpy (1.6.0) and loadtxt has the ndmin >> option, >> however neither genfromtxt nor recfromtxt, which use loadtxt, have it. >> Should they have inherited the option? Who can make

Re: [Numpy-discussion] reinterpret complex <-> float

2011-06-03 Thread Warren Weckesser
On Fri, Jun 3, 2011 at 1:46 PM, Neal Becker wrote: > Can I arrange to reinterpret an array of complex of length N as an array of > float of length 2N, and vice-versa? If so, how? > You can use the view() method (if the data is contiguous): In [14]: z = array([1.0+1j, 2.0+3j, 4, 9j]) In [15]:

Re: [Numpy-discussion] reinterpret complex <-> float

2011-06-03 Thread Robert Kern
On Fri, Jun 3, 2011 at 13:46, Neal Becker wrote: > Can I arrange to reinterpret an array of complex of length N as an array of > float of length 2N, and vice-versa?  If so, how? [~] |1> carr = np.arange(10, dtype=complex) [~] |2> carr array([ 0.+0.j, 1.+0.j, 2.+0.j, 3.+0.j, 4.+0.j, 5.+0.j,

[Numpy-discussion] reinterpret complex <-> float

2011-06-03 Thread Neal Becker
Can I arrange to reinterpret an array of complex of length N as an array of float of length 2N, and vice-versa? If so, how? ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] numpy input with genfromttxt()

2011-06-03 Thread Olivier Delalleau
2011/6/3 Bruce Southey > On 06/03/2011 10:33 AM, jonasr wrote: > > > > > > Bruce Southey wrote: > >> On 06/03/2011 09:33 AM, jonasr wrote: > >>> thank you very much, works much nicer and faster in comparison to the > >>> script > >>> i wrote and used before , > >>> im not that much used to lambd

Re: [Numpy-discussion] numpy input with genfromttxt()

2011-06-03 Thread Bruce Southey
On 06/03/2011 10:33 AM, jonasr wrote: > > > Bruce Southey wrote: >> On 06/03/2011 09:33 AM, jonasr wrote: >>> thank you very much, works much nicer and faster in comparison to the >>> script >>> i wrote and used before , >>> im not that much used to lambda forms but it seems quit usefull in >>> si

Re: [Numpy-discussion] numpy easy_install fails for python 3.2

2011-06-03 Thread Ralf Gommers
On Wed, May 4, 2011 at 8:51 PM, Matthew Brett wrote: > Hi, > > On Wed, May 4, 2011 at 1:23 PM, Ralf Gommers > wrote: > > > > > > On Wed, May 4, 2011 at 6:53 PM, Matthew Brett > > wrote: > >> > >> Hi, > >> > >> I can imagine that this is low-priority, but I have just been enjoying > >> pytox for

Re: [Numpy-discussion] numpy input with genfromttxt()

2011-06-03 Thread jonasr
Bruce Southey wrote: > > On 06/03/2011 09:33 AM, jonasr wrote: >> thank you very much, works much nicer and faster in comparison to the >> script >> i wrote and used before , >> im not that much used to lambda forms but it seems quit usefull in >> situations like this >> >> >> Olivier Delallea

Re: [Numpy-discussion] numpy input with genfromttxt()

2011-06-03 Thread Bruce Southey
On 06/03/2011 09:33 AM, jonasr wrote: thank you very much, works much nicer and faster in comparison to the script i wrote and used before , im not that much used to lambda forms but it seems quit usefull in situations like this Olivier Delalleau-2 wrote: Here's an ugly one-liner: numpy.genf

Re: [Numpy-discussion] [Repost] Adding the arrays returned in an array iterator

2011-06-03 Thread Charles R Harris
On Thu, Jun 2, 2011 at 7:36 PM, srean wrote: > Bumping my question tentatively. I am fairly sure there is a good answer > and for some reason it got overlooked. > > Regards > srean > > -- Forwarded message -- > From: srean > Date: Fri, May 27, 2011 at 10:36 AM > Subject: Adding

Re: [Numpy-discussion] numpy input with genfromttxt()

2011-06-03 Thread jonasr
thank you very much, works quit nice and faster in comparison to the script i wrote and used before , im not that much used to lambda forms but it seems quit usefull in situations like this Olivier Delalleau-2 wrote: > > Here's an ugly one-liner: > > numpy.genfromtxt('data.txt', converters=d

Re: [Numpy-discussion] numpy input with genfromttxt()

2011-06-03 Thread gary ruben
I think the easiest is to use an intermediate string. If your file is test.txt, In [22]: a = file('test.txt').read().replace(',','.') In [23]: import StringIO In [24]: b=genfromtxt(StringIO.StringIO(a)) In [25]: b Out[25]: array([[ 0.e+00, 1.2210e-03, 1.2210e-03, 0.00

Re: [Numpy-discussion] numpy input with genfromttxt()

2011-06-03 Thread Olivier Delalleau
Here's an ugly one-liner: numpy.genfromtxt('data.txt', converters=dict([k, lambda x: float(x.replace(',', '.'))] for k in range(len(open('data.txt').readline().strip().split() -=- Olivier 2011/6/3 jgrub > > Hello, im actually try to read in data with genfromtxt(), > i want to read in numb

Re: [Numpy-discussion] need help building a numpy extension that uses fftpack on windows

2011-06-03 Thread Sturla Molden
Den 02.06.2011 21:07, skrev Ralf Gommers: > > After search for multi-taper I found > http://projects.scipy.org/scipy/ticket/608. Too bad no one has gotten > around to review your contribution before, it sounds like a good > addition for the scipy.signal module. I once implemented DPSS tapers in

[Numpy-discussion] numpy input with genfromttxt()

2011-06-03 Thread jgrub
Hello, im actually try to read in data with genfromtxt(), i want to read in numbers which are stored in a textfile like this: 0,000,0012210,0012210,001,278076 160,102539 4,00E-7 0,000,000,0024411,279297

Re: [Numpy-discussion] need help building a numpy extension that uses fftpack on windows

2011-06-03 Thread Ralf Gommers
On Thu, Jun 2, 2011 at 9:33 PM, Robert Kern wrote: > On Thu, Jun 2, 2011 at 14:07, Ralf Gommers > wrote: > > > > On Wed, Jun 1, 2011 at 5:45 PM, martin smith > wrote: > >> > >> I have a bit of code that performs multi-taper power spectra using numpy > >> and a C extension module. The C portion