[SciPy-user] fft giving error

Christian Kristukat ckkart at hoc.net
Fri Oct 20 02:06:29 CDT 2006


Alan Jackson wrote:
> I'm trying to run the example from http://linuxgazette.net/115/andreasen.html
> to plot the frequency spectrum of sunspot numbers from ipython...
> 
>      from scipy import *
>      from scipy import fftpack
>      
>      from scipy.io import read_array
>      sunspot = read_array('sunspots.dat')
>      
>      year=sunspot[:,0]
>      wolfer=sunspot[:,1]
>      Y=fft(wolfer)
> 
> and I get the following error....
> 
> 
> In [68]: Y=fft(wolfer)
> ---------------------------------------------------------------------------
> exceptions.TypeError                                 Traceback (most recent call last)
> 
> /home/ajackson/projects/cyclicity/<console> 
> 
> TypeError: 'module' object is not callable

I think, some numpy/scipy modules have been rearranged since that article was
written. In fact the line
from scipy import fftpack
is not needed since fftpack is not used in the script.
With
from scipy import *
you'll now import a *module* called fft. The function you're looking for is then
called fft.fft. Try help(fft).

Christian


More information about the SciPy-user mailing list