Re: [Numpy-discussion] Assigning complex values to a real array

2009-03-06 Thread Charles R Harris
On Fri, Mar 6, 2009 at 6:18 PM, Stéfan van der Walt wrote: > Hi all, > > The following code succeeds, while I thought it should fail: > > a = np.zeros(6) # real > b= np.arange(6)*(2+3j) # complex > a[1] = b[1] # shouldn't this break? > > What is the rationale behind this behaviour? > The same as

[Numpy-discussion] Assigning complex values to a real array

2009-03-06 Thread Stéfan van der Walt
Hi all, The following code succeeds, while I thought it should fail: a = np.zeros(6) # real b= np.arange(6)*(2+3j) # complex a[1] = b[1] # shouldn't this break? What is the rationale behind this behaviour? Cheers Stéfan ___ Numpy-discussion mailing li

Re: [Numpy-discussion] can't take FFT of ndarray

2009-03-06 Thread charles reid
Fixed the problem - I was importing a bunch of numbers from a file, and I wasn't casting them as doubles. Thanks for the help! Charles On Fri, Mar 6, 2009 at 4:26 PM, Charles R Harris wrote: > > > On Fri, Mar 6, 2009 at 4:22 PM, charles reid wrote: > >> In [3]: mixfracarray=array(mixfrac) >> >

Re: [Numpy-discussion] can't take FFT of ndarray

2009-03-06 Thread Charles R Harris
On Fri, Mar 6, 2009 at 4:22 PM, charles reid wrote: > In [3]: mixfracarray=array(mixfrac) > > In [4]: mixfracarray.dtype > Out[4]: dtype('|S17') > It's a string array. What does your file look like and how do you import it? Chuck ___ Numpy-discussion

Re: [Numpy-discussion] can't take FFT of ndarray

2009-03-06 Thread Matthieu Brucher
This indicates that the values are strings, so you can't make an FFT from them. Convert your array to float or double array first. Matthieu 2009/3/7 charles reid : > In [3]: mixfracarray=array(mixfrac) > > In [4]: mixfracarray.dtype > Out[4]: dtype('|S17') > > > > On Fri, Mar 6, 2009 at 4:09 PM,

Re: [Numpy-discussion] can't take FFT of ndarray

2009-03-06 Thread charles reid
In [3]: mixfracarray=array(mixfrac) In [4]: mixfracarray.dtype Out[4]: dtype('|S17') On Fri, Mar 6, 2009 at 4:09 PM, Charles R Harris wrote: > > > On Fri, Mar 6, 2009 at 3:51 PM, charles reid wrote: > >> In [3]: type(mixfrac) >> Out[3]: >> >> In [4]: mixfracarray=array(mixfrac) >> >> In [5]:

Re: [Numpy-discussion] can't take FFT of ndarray

2009-03-06 Thread Charles R Harris
On Fri, Mar 6, 2009 at 3:51 PM, charles reid wrote: > In [3]: type(mixfrac) > Out[3]: > > In [4]: mixfracarray=array(mixfrac) > > In [5]: type(mixfracarray) > Out[5]: > > Try mixfracarray.dtype ...Chuck ___ Numpy-discussion mailing list Numpy-discus

Re: [Numpy-discussion] can't take FFT of ndarray

2009-03-06 Thread charles reid
In [3]: type(mixfrac) Out[3]: In [4]: mixfracarray=array(mixfrac) In [5]: type(mixfracarray) Out[5]: (Is that what you were referring to?) On Fri, Mar 6, 2009 at 3:44 PM, Charles R Harris wrote: > > > On Fri, Mar 6, 2009 at 3:36 PM, charles reid wrote: > >> Hi there - >> >> I've imported s

Re: [Numpy-discussion] can't take FFT of ndarray

2009-03-06 Thread Charles R Harris
On Fri, Mar 6, 2009 at 3:36 PM, charles reid wrote: > Hi there - > > I've imported some data from a file, and it's in a list called mixfrac. > I'd like to take the Fourier transform of the data, but when I try to take > the FFT of the list, I get this error: > > --

Re: [Numpy-discussion] can't take FFT of ndarray

2009-03-06 Thread charles reid
Hi there - I've imported some data from a file, and it's in a list called mixfrac. I'd like to take the Fourier transform of the data, but when I try to take the FFT of the list, I get this error: --- TypeError

Re: [Numpy-discussion] Changeset 6557

2009-03-06 Thread Charles R Harris
On Fri, Mar 6, 2009 at 2:01 PM, Charles R Harris wrote: > Hi David, > > Currently, > > bint.i = __STR2INTCST("ABCD"); > > It is probably more portable to just initialize the union > > union { > char c[4]; > npy_uint32 i; > } bint = {'A','B','C','D'}; > > > If you use const

[Numpy-discussion] Changeset 6557

2009-03-06 Thread Charles R Harris
Hi David, Currently, bint.i = __STR2INTCST("ABCD"); It is probably more portable to just initialize the union union { char c[4]; npy_uint32 i; } bint = {'A','B','C','D'}; If you use const union the initialization will be done at compile time. Chuck ___

[Numpy-discussion] Build Failure on WIndows Vista

2009-03-06 Thread Patrick Marsh
Greetings, I am running Windows Vista Ultimate and trying to build numpy from the SVN branch using MSVC 2003. I have been able to build previously, but with my latest SVN update I am no longer able to build. My CPU is an Intel Core2 T7600 @2.33GHz. The error is below. e:\svn\numpy\numpy\core\i

Re: [Numpy-discussion] numpy-svn mails

2009-03-06 Thread Peter Wang
On Mar 6, 2009, at 12:46 PM, Charles R Harris wrote: > On Fri, Mar 6, 2009 at 8:28 AM, Ryan May wrote: > Hi, > > Is anyone getting mails of the SVN commits? I've gotten 1 spam > message from that list, but no commits. > > Ryan > > I'm not seeing them either...Chuck Hey guys, I'm working on th

Re: [Numpy-discussion] numpy-svn mails

2009-03-06 Thread Charles R Harris
On Fri, Mar 6, 2009 at 8:28 AM, Ryan May wrote: > Hi, > > Is anyone getting mails of the SVN commits? I've gotten 1 spam message > from that list, but no commits. > > Ryan > I'm not seeing them either...Chuck ___ Numpy-discussion mailing list Numpy-di

Re: [Numpy-discussion] Cython numerical syntax revisited

2009-03-06 Thread Anne Archibald
2009/3/5 Francesc Alted : > A Thursday 05 March 2009, Francesc Alted escrigué: >> Well, I suppose that, provided that Cython could perform the for-loop >> transformation, giving support for strided arrays would be relatively >> trivial, and the performance would be similar than numexpr in this >> c

Re: [Numpy-discussion] Cython numerical syntax revisited

2009-03-06 Thread Matthew Brett
Hi, > The idea behind the current syntax was to keep things as close as > possible to Python/NumPy, and only provide some "hints" to Cython for > optimization. My problem with this now is that a) it's too easy to get > non-optimized code without a warning by letting in untyped indices, b) I > thin

Re: [Numpy-discussion] Interpolation via Fourier transform

2009-03-06 Thread Nadav Horesh
It was one of the first things I tried, without success Nadav. -הודעה מקורית- מאת: numpy-discussion-boun...@scipy.org בשם Anne Archibald נשלח: ה 05-מרץ-09 22:06 אל: Discussion of Numerical Python נושא: Re: [Numpy-discussion] Interpolation via Fourier transform 2009/3/5 M Trumpis : > Hi

Re: [Numpy-discussion] Interpolation via Fourier transform

2009-03-06 Thread Stéfan van der Walt
Hi Nadav You can also read the interesting discussion at http://projects.scipy.org/numpy/ticket/748 which also contains some padding code. I still disagree with the conclusion, but oh well :) Cheers Stéfan 2009/3/6 Nadav Horesh : > I found the solution I needed for my peculiar case after read

Re: [Numpy-discussion] N-D array interface page is out of date

2009-03-06 Thread Andrew Straw
Hi, I have updated http://numpy.scipy.org/array_interface.shtml to have a giant warning first paragraph describing how that information is outdated. Additionally, I have updated http://numpy.scipy.org/ to point people to the buffer interface described in PEP 3118 and implemented in Python 2.6/

Re: [Numpy-discussion] Interpolation via Fourier transform

2009-03-06 Thread Nadav Horesh
I found the solution I needed for my peculiar case after reading your email based of the following stages: I have a N x N frequency-domain matrix Z 1. Use fftshift to obtain a DC centered matrix Note: fftshift(fft(a)) replaces np.fft.fft(np.power(-1,np.arange(64))*a) Zs = np.fft.fftshift(Z

[Numpy-discussion] numpy-svn mails

2009-03-06 Thread Ryan May
Hi, Is anyone getting mails of the SVN commits? I've gotten 1 spam message from that list, but no commits. Ryan -- Ryan May Graduate Research Assistant School of Meteorology University of Oklahoma ___ Numpy-discussion mailing list Numpy-discussion@sc

[Numpy-discussion] setmember1d_nu

2009-03-06 Thread Robert Cimrman
Hi all, I have added to the ticket [1] a script that compares the proposed setmember1d_nu() implementations of Neil and Kim. Comments are welcome! [1] http://projects.scipy.org/numpy/ticket/1036 r. ___ Numpy-discussion mailing list Numpy-discussion@sc