title: python: Fast Fourier Transform data points (0) when the vector being passed through is non zero or NaN
body: <p>I am trying to set up a different numerical integration for each value of <code>N</code>.  All my variables dependent on <code>N</code> are returning correctly (I printed the results to make sure everything was coming back fine without NaN or all zeros).  However, I keep receiving the following error:</p>
  
  <pre><code>ValueError: Invalid number of FFT data points (0) specified.
  </code></pre>
  
  <p>But the <code>u</code> vector has data points.</p>
  
  <pre><code>import numpy as np
  
  L = 80.0
  dt = 0.0002
  tmax = 10
  nmax = int(np.floor(tmax / dt))
  deltax = []
  error = []
  
  for N in [1., 2., 4., 8., 16., 32., 64., 128., 256., 512.]:
      dx = L / N
      deltax.append(dx)
      x = np.arange(-L / 2.0, L / 2.0 - dx, dx)
      k = np.hstack((np.arange(0, N / 2.0 - 1.0),
                     np.arange(-N / 2.0, 0))).T * 2.0 * np.pi / L
      k1 = 1j * k
      k3 = (1j * k) ** 3
      u = 2 * (2 / (np.exp(x + 20.0) + np.exp(-x - 20.0))) ** 2
      udata = u
      tdata = 0.0
      #  integration
      for nn in range(1, nmax + 1):
          du1 = (-np.fft.ifft(k3 * np.fft.fft(u)) -
                 3 * np.fft.ifft(k1 * np.fft.fft(u ** 2)))
          v = u + 0.5 * du1 * dt
          du2 = (-np.fft.ifft(k3 * np.fft.fft(v)) -
                 3 * np.fft.ifft(k1 * np.fft.fft(v ** 2)))
          v = u + 0.5 * du2 * dt
          du3 = (-np.fft.ifft(k3 * np.fft.fft(v)) -
                 3 * np.fft.ifft(k1 * np.fft.fft(v ** 2)))
          v = u + du3 * dt
          du4 = (-np.fft.ifft(k3 * np.fft.fft(v)) -
                 3 * np.fft.ifft(k1 * np.fft.fft(v ** 2)))
          u = u + (du1 + 2.0 * du2 + 2.0 * du3 + du4) * dt / 6.0
          error.append(max(abs(u[:,-1] - 2. *
                               (2. / (np.exp(x - 20) + np.exp(-x - 60))))))
          if np.mod(nn, np.ceil(nmax / 20.0)) == 0:
              udata = np.vstack((udata, u))
              tdata = np.vstack((tdata, nn * dt))
  </code></pre>
  
  <p>So all the vectors are being populate but I don't know what the problem is.
  If I set <code>N</code> to one number and remove that <code>for</code> loop, everything works fine but when I add the loop, it all breaks down.
  Unfortunately, I can't figure it out.</p>
  
  <p>If you test the code by setting <code>N = 64</code> or something, you then have to comment out <code>deltax</code> and <code>error.append</code>.</p>