[Numpy-discussion] numpy.fftpack: axis=None ?

PGM pgmdevlist at gmail.com
Wed Sep 6 04:52:11 CDT 2006

I was playing around the numpy.fftpack when I ran into the problem below:
it seems that axis=None is not valid with fft. Is there a reason for that ? I 
was assuming a behavior similar to other functions, where axis=None 
translates to "use a flat array".

>>> N.fft.fft(N.arange(100).reshape(10,10),128,None)  
/usr/lib64/python2.4/site-packages/numpy/fft/fftpack.py in fft(a, n, axis)
     85     different n's."""
---> 87     return _raw_fft(a, n, axis, fftpack.cffti, fftpack.cfftf, 

/usr/lib64/python2.4/site-packages/numpy/fft/fftpack.py in _raw_fft(a, n, 
axis, init_function, work_function, fft_cache)
     44         fft_cache[n] = wsave
---> 46     if a.shape[axis] != n:
     47         s = list(a.shape)
     48         if s[axis] > n:

TypeError: tuple indices must be integers

More information about the Numpy-discussion mailing list