title: Removing p% of smallest numpy array
body: <p>I am using Python 3.7 and numpy 1.18. I have a multi-dimensional numpy array of shape (28, 28, 3) and within this np array, I want to remove the 20% of smallest weights. Removing the 20% of smallest weights means I mask such numbers with 0.</p>
  
  <p>20% of (28, 28, 3) = 470.4 = 470 (after rounding-off).</p>
  
  <p>So, for this np array, for the 470 smallest numbers, how can I mask them to zero?</p>
  
  <p>Thanks!</p>