numpy.cov or numpy.linalg.eigvals gives wrong results
<p>I have high (100) dimensional data. I want to get the eigenvectors of the covariance matrix of the data.</p>

<pre><code>Cov = numpy.cov(data)
EVs = numpy.linalg.eigvals(Cov) 
</code></pre>

<p>I get a vector containing some eigenvalues which are complex numbers. This is mathematically impossible. Granted, the imaginary parts of the complex numbers are very small but it still causes issues later on. Is this a numerical issue? If so, does the issue lie with cov, eigvals function or both?</p>

<p>To give more color on that, I did the same calculation in Mathematica which gives, of course, a correct result. Turns out there are some eigenvalues which are very close to zero but not quiet zero and numpy gets all of these wrong (magnitude wise and it makes some of them into complex numbers)</p>