title: How to add non-zero elements to noise?
body: <p>I have a numpy array and a noise function.</p>
  
  <pre><code>def gaussian_noise(X,sigma=0.1):
      noise = np.random.normal(0, sigma, X.shape)
      return X + noise
  </code></pre>
  
  <p><strong>How to add some noise to non zero element?</strong>
  For example:</p>
  
  <pre><code># input an array
  a = array([[1, 0, 3],
             [2, 5, 0],
             [0, 0, 7]])
  b = gaussian_noise(a)
  </code></pre>
  
  <p><strong>Output:</strong></p>
  
  <pre><code>b = array([[ 0.83781175, 0.,  2.99969046],
             [ 1.92693919,  4.85350012,  0.],
             [0.,  0.,  7.04896986]])
  </code></pre>
  
  <p>How can I modify my function?</p>