title: Remove lines with an infinite value from array
body: <p>I have a numpy array</p>
  
  <pre><code>A = np.array([[1, 2, 3, 4], 
               [2, float('inf'), 3, 4],
               [5, 6, 7, 8]])  
  </code></pre>
  
  <p>I would like to remove the lines that contain an infinite value in them so that the results would be</p>
  
  <pre><code>np.array([[1,2,3,4],
            [5,6,7,8]])
  </code></pre>
  
  <p>I tried to do <code>A = A[float('inf') not in A]</code>, but the result is <code>array([], shape=(0, 3, 4), dtype=float64)</code>. </p>
  
  <p>I could do</p>
  
  <pre><code>B = []
  for line in A:
      if float('inf') not in line:
          B.append(line)
  A = np.array(B)
  </code></pre>
  
  <p>but is there a better way to do this?</p>