title: How to turn a boolean array into index array in numpy
body: <p>Is there an efficient Numpy mechanism to retrieve the integer indexes of locations in an array based on a condition is true as opposed to the Boolean mask array?</p>
  
  <p>For example:</p>
  
  <pre><code>x=np.array([range(100,1,-1)])
  #generate a mask to find all values that are a power of 2
  mask=x&amp;(x-1)==0
  #This will tell me those values
  print x[mask]
  </code></pre>
  
  <p>In this case, I'd like to know the indexes <code>i</code> of <code>mask</code> where <code>mask[i]==True</code>.  Is it possible to generate these without looping?</p>