nipunbatra/ProgramaticallyUnderstandingSeries

ft.ipynb : using // instead of / to divide length by 2

emielsteerneman opened this issue · 0 comments

In the file ft.ipynb, the following line gives me an error:
plt.plot(frq[:len(data)/2], abs(np.fft.fft(data))[:len(data)/2])
TypeError: slice indices must be integers or None or have an __index__ method

Replacing the / with // fixes it (for me at least):
plt.plot(frq[:len(data)//2], abs(np.fft.fft(data))[:len(data)//2])