title: NumPy FFT tuple index out of range?
body: <p>I was running ffts no problem last week, now I'm getting some strange errors:</p>
  
  <pre><code>Traceback (most recent call last):
    File "call.py", line 52, in &lt;module&gt;
      main()
    File "call.py", line 50, in main
      validate(temp_path)
    File "call.py", line 35, in validate
      ivr_wav = IVR_Wav(validate_path)
    File "call.py", line 42, in __init__
      self.fft = get_fft(temp_wav_path)
    File "call.py", line 21, in get_fft
      return numpy.fft.fft(frames)
    File "/usr/lib/python2.7/dist-packages/numpy/fft/fftpack.py", line 174, in fft
      return _raw_fft(a, n, axis, fftpack.cffti, fftpack.cfftf, _fft_cache)
    File "/usr/lib/python2.7/dist-packages/numpy/fft/fftpack.py", line 50, in _raw_fft
      n = a.shape[axis]
  IndexError: tuple index out of range
  </code></pre>
  
  <p>My code is:</p>
  
  <pre><code>def get_fft(fft_path):
      wav = wave.open(fft_path, 'r')
      frames = wav.readframes(wav.getnframes())
      wav.close()
      return numpy.fft.fft(frames)
  </code></pre>
  
  <p>and the NumPy code is:</p>
  
  <pre><code>def _raw_fft(a, n=None, axis=-1, init_function=fftpack.cffti,work_function=fftpack.cfftf, fft_cache = _fft_cache ):
      a = asarray(a)
      if n is None:
           n = a.shape[axis]
      if n &lt; 1:
           raise ValueError("Invalid number of FFT data points (%d) specified." % n)
  </code></pre>
  
  <p>It makes sense that <code>-1</code> is out of range for a tuple, but how can I remedy this?  I don't quite know, but I believe calling <code>numpy.fft.fft(path, axis=0)</code> should allow the <code>n=a.shape[axis]</code> to execute, but will this set n to the length in samples?  Is this even what is proper?  I am not super familiar with numpy and nd-arrays.</p>