title: Remove elements from numpy array smaller than 1
body: <p>I am trying to plot large data (50 million values) but I am getting a <code>MemoryError</code>. Now I am trying to clear my dataset from redundant values. In my case, these are all values below <code>1</code> and above <code>-1</code>. One thing to keep in mind is that the plot should look the same as the original, but without the noise. Is there a better way to do this than using <code>loops</code> or <code>list comprehensions</code>? </p>
  
  <p>Original Plot:</p>
  
  <p><a href="https://i.stack.imgur.com/GMaMl.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GMaMl.png" alt="enter image description here"></a></p>
  
  <p><strong>Edit:</strong></p>
  
  <p>Thank you for the replies. If I use the proposed approach:</p>
  
  <pre><code>daty = daty[(-1 &gt; daty) | (daty &gt; 1)]
  </code></pre>
  
  <p>It results in this:</p>
  
  <p><a href="https://i.stack.imgur.com/inQVx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/inQVx.png" alt="enter image description here"></a></p>