title: Replacing all elements except NaN in Python
body: <p>I want to replace all elements in array <code>X</code> except <code>nan</code> with <code>10.0</code>. Is there a one-step way to do it? I present the expected output.</p>
  <pre><code>import numpy as np
  from  numpy import nan
  
  X = np.array([[3.25774286e+02, 3.22008654e+02, nan, 1.85356823e+02,
          1.85356823e+02, 3.22008654e+02, nan, 3.22008654e+02]])
  </code></pre>
  <p>The expected output is</p>
  <pre><code>X = array([[10.0, 10.0, nan, 10.0,
          10.0, 10.0, nan, 10.0]])
  </code></pre>