[Numpy-discussion] FFT of 2D array along last axis

Brad Buran bburan at alum.mit.edu
Thu Nov 6 17:51:02 EST 2014


Given the following code:

import numpy as np
x = np.random.random(size=2**14)
y = x.copy()
z = np.concatenate([x[np.newaxis], y[np.newaxis]], axis=0)
print(np.all(np.fft.fft(z, axis=-1)[0] == np.fft.fft(z[0])))

On Windows 7 using Anaconda with numpy 1.9.1 I get False (indicating that
the FFT is not treating each row separately).  When I test on a Ubuntu box
using numpy 1.9.1 I get True.  Is this expected behavior?  If I understand
the documentation correctly, the FFT on each row should be independent
(i.e. the result should not be influenced by the other rows).

Brad
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20141106/7567aa48/attachment.html>


More information about the NumPy-Discussion mailing list