title: How to numpy.nan*0=0
body: <p>I would like to have python make the product</p>
  
  <pre><code>numpy.nan*0
  </code></pre>
  
  <p>return 0 (instead of nan), but e.g.</p>
  
  <pre><code>numpy.nan*4
  </code></pre>
  
  <p>still return nan.</p>
  
  <p>My application: I have some numpy matrices which I am multiplying with one another. These contain many nan entries, and plenty of zeros.
  The nans always represent unknown, but finite values which are known to become zero when multiplied with zero.
  So I would like <code>A*B</code> return <code>[1,nan],[nan,1]</code> in the following example:</p>
  
  <pre><code>import numpy as np
  A=np.matrix('1 0; 0 1')
  B=np.matrix([[1, np.nan],[np.nan, 1]])
  </code></pre>
  
  <p>Is this possible?</p>
  
  <p>Many thanks</p>