[SciPy-user] linalg.eigvals

Gary pajer at iname.com
Wed Aug 17 08:47:18 CDT 2005


Nils Wagner wrote:

>Hi all,
>
>Is this a bug or a feature
>
>  
>
>>>>A = mat(1)
>>>>linalg.eigvals(A)
>>>>        
>>>>
>array([ 1.+0.j])
>  
>
>>>>A = array(([1]))
>>>>linalg.eigvals(A)
>>>>        
>>>>
>Traceback (most recent call last):
>  File "<stdin>", line 1, in ?
>  File "/usr/lib/python2.4/site-packages/scipy/linalg/decomp.py", line
>163, in eigvals
>    return eig(a,b=b,left=0,right=0,overwrite_a=overwrite_a)
>  File "/usr/lib/python2.4/site-packages/scipy/linalg/decomp.py", line
>107, in eig
>    raise ValueError, 'expected square matrix'
>ValueError: expected square matrix
>  
>
>
>  
>
I think you have a typo.
Try
A = array([[1]])     (notice the square brackets)

-gary

>Nils
>
>_______________________________________________
>SciPy-user mailing list
>SciPy-user at scipy.net
>http://www.scipy.net/mailman/listinfo/scipy-user
>
>  
>




More information about the SciPy-user mailing list