problem with decimate in scipy 0.18 I use scipy.signal.decimate  to downsample a large spectroscopic data-set.
This has worked superbly so far.

yy = decimate(data.row(i).buffer, n2, ftype = "fir")


I used successively to downsample the spectrum to several lower resolutions.

When I moved from scipy 0.17 to 0.18 (actually 0.18.1) during of a python3 port, a problem appeared.
The first downsampling works, on all the rows; but the next one crashes with the following message:

File "..../lib/python3.5/site-packages/scipy/signal/signaltools.py", line 3049, in decimate
raise TypeError("q must be an integer")
TypeError: q must be an integer


I looked to the code, but with no avail. I also tried the new zero_phase=True argument, but did not help. Needless to say that my n2 argument above IS an integer, the second time as well as the first time!

Any pointers ?
I have found the bug !
n2 is indeed a integer in my case, but its not an int()

print(type(n2)) gives:   &lt;class 'numpy.int64'&gt;   !!!

In the previous version of scipy, it was already a numpy.int64 but it was working correctly.

Maybe a test slightly too stringent...

Thanks for helping everyone.