title: How to conditionally select elements in numpy array
body: <p>Can someone help me with conditionally selecting elements in a numpy array? I am trying to return elements that are greater than a threshold. My current solution is:</p>
  
  <pre><code>sampleArr = np.array([ 0.725, 0.39, 0.99 ])
  condition = (sampleArr &gt; 0.5)`
  extracted = np.extract(condition, sampleArr) #returns [0.725 0.99]
  </code></pre>
  
  <p>However, this seems roundabout and I suspect there's a way to do it in one line?</p>