<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">a = np.eye(4)
np.fft.ifftn(np.fft.fftn(a, axes=(0,)), axes=(1,))
# array([[ 1.+0.j,  0.+0.j,  0.+0.j,  0.+0.j],
# [ 0.+0.j,  1.+0.j,  0.+0.j,  0.+0.j],
# [ 0.+0.j,  0.+0.j,  1.+0.j,  0.+0.j],
# [ 0.+0.j,  0.+0.j,  0.+0.j,  1.+0.j]])

# Create and plot an image with band-limited frequency content:

import matplotlib.pyplot as plt
n = np.zeros((200,200), dtype=complex)
n[60:80, 20:40] = np.exp(1j*np.random.uniform(0, 2*np.pi, (20, 20)))
im = np.fft.ifftn(n).real
plt.imshow(im)
# &lt;matplotlib.image.AxesImage object at 0x...&gt;
plt.show()
</pre></body></html>