title: sqrtm() function returns nan
body: <p>I have a <code>512 x 512</code> matrix <code>Avg</code> and it has many zero and non-zero values. Now I want an inplace element-wise square root of the matrix. This is part of my code</p>
  
  <pre><code>import numpy as np
  from scipy.linalg import sqrtm
  
  Avg = sqrtm(Avg)
  np.savetxt('Avg.txt', Avg)
  </code></pre>
  
  <p>But, the output is all <code>nan</code> and it says that the matrix is singular and may not have a square root.</p>