I use the latest version of numpy/scipy.
The following script does not work:
import numpy as np
import matplotlib.pyplot as plt
from scipy.fftpack import fft, fftshift, fftfreq
hn= np.ones(10)
hF = fft(hn,1024)
shifted = fftshift(hF)
It gives the following error message:
Traceback (most recent call last):
File "D:\deleteme\New3.py", line 6, in <module>
shifted = fftshift(hF)
File "C:\Python26\lib\site-packages\numpy\fft\helper.py", line 40, in fftshift
y = take(y,mylist,k)
File "C:\Python26\lib\site-packages\numpy\core\fromnumeric.py", line 103, in take
return take(indices, axis, out, mode)
TypeError: array cannot be safely cast to required type
EDIT: i have found the problem. My python interpreter was implicitly called (via my editor settings) with the -Qnew option. This apparently breaks scipy code. Thanks to all who responded!