title: multi-dimensional array in python using numpy.where
body: <p>I am a beginner with python and am going through a tutorial but could not achieve the proper results. </p>
  
  <p>I would like to know where I could have gone wrong!</p>
  
  <pre><code>binFreq = np.arange(N / 2 + 1) * float(fs) / N
  squaredMX = np.square(mX)
  lowBandIdx0 = np.where(binFreq &gt; 0)[0][0]
  
  lowBandIdx3000 = np.where(binFreq &lt; 3000)[0][-1]
  
  highBandIdx3000 = np.where(binFreq &gt; 3000)[0][0]
  
  highBandIdx10000 = np.where(binFreq &lt; 10000)[0][-1]
  
  lowBandSqMX = squaredMX[:,lowBandIdx0:lowBandIdx3000+1]
  highBandSqMX = squaredMX[:,highBandIdx3000:highBandIdx10000+1]
  engEnv = np.zeros((numFrames, 2))
  engEnv[:, 0] = 10*np.log10(np.sum(lowBandSqMX, 1))
  engEnv[:, 1] = 10*np.log10(np.sum(highBandSqMX, 1))
  </code></pre>
  
  <p>I would especially like to understand what these lines do:</p>
  
  <pre><code>lowBandIdx3000 = np.where(binFreq &lt; 3000)[0][-1]
  highBandIdx10000 = np.where(binFreq &lt; 10000)[0][-1]
  </code></pre>