title: How to filter very sparse features from a data set
body: <p>I am try to preprocess a data set and I'd like to delete very sparse columns by setting a threshold such that columns with values less than that have entries fewer than the threshold will be removed. </p>
  
  <p>The code below should get the job done but I do not understand how it works, kindly assist with an explanation or suggestions on how I can get this done. Thanks!</p>
  
  <pre><code>sparse_col_idx = ((x_sparse &gt; 0).mean(0) &gt; 0.05).A.ravel()
  </code></pre>
  
  <p>x_sparse has dim of (12060, 272776)</p>