title: how do I remove columns from a collection of ndarrays that correspond to zero elements of one of the arrays?
body: <p>I have some data in 3 arrays with shapes:</p>
  
  <pre><code>docLengths.shape = (10000,)
  docIds.shape = (10000,)
  docCounts.shape = (68,10000)
  </code></pre>
  
  <p>I want to obtain relative counts and their means and standard deviations for some i:</p>
  
  <pre><code>docRelCounts = docCounts/docLengths
  relCountMeans = docRelCounts[i,:].mean()
  relCountDeviations = docRelCounts[i,:].std()
  </code></pre>
  
  <p>Problem is, some elements of docLengths are zero. This produces NaN elements in docRelCounts and the means and deviations are thus also NaN.</p>
  
  <p>I need to remove the data for documents of zero length. I could write a loop, locating zero length doc's and removing them, but I was hoping for some numpy array magic that would do this more efficiently. Any ideas?</p>