title: Ignoring -Inf values in arrays using numpy/scipy in Python
body: <p>I have an NxM array in numpy that I would like to take the log of, and ignore entries that were negative prior to taking the log. When I take the log of negative entries, it returns -Inf, so I will have a matrix with some -Inf values as a result. I then want to sum over the columns of this matrix, but ignoring the -Inf values -- how can I do this?</p>
  
  <p>For example,</p>
  
  <pre><code>mylogarray = log(myarray)
  # take sum, but ignore -Inf?
  sum(mylogarray, 0)
  </code></pre>
  
  <p>I know there's nansum and I need the equivalent, something like infsum.</p>
  
  <p>Thanks.</p>