title: get prime numbers from numpy array
body: <p>I have a numpy array like,</p>
  
  <pre><code>nums = np.array([17, 18, 19, 20, 21, 22, 23])
  </code></pre>
  
  <p>How do I filter out the prime numbers from this array in a pythonic manner?
  I know to do a simple filtering like,</p>
  
  <pre><code>nums[nums &gt; 20]   #array([21, 22, 23])
  </code></pre>
  
  <p>Is there a way to pass a lambda function for filtering?</p>
  
  <p><em>Expected output: array([17, 19, 23])</em></p>