Wrong Eigenvalue (Approximation?)
16 May
2010
16 May
'10
4:03 a.m.
Hello, all! I'm new to Numpy and Python so please tolerate by ignorance on this but I'm having problems with some weird behavior. Consider the session:
import numpy as np import numpy.linalg as la x = np.array([[0.3, 0.2, 0.5], [0.2, 0.1, 0.7], [0.9, 0.05, 0.05]]).transpose() esystem = la.eig(x) esystem[0] array([ 1. , -0.3 , -0.25]) esystem[0][0] 1.0000000000000004
The eigenvalue should be 1 exactly. In fact, later on I want to be able to do np.where(x == 1) which fails. The way I set up the matrix, I know for sure that there must be one eigenvalue exactly equal to 1. Any help is greatly appreciated! This is all on Python 2.6.5 (r265:79096, Mar 19 2010, 21:48:26) [MSC v.1500 32 bit (Intel)] on win32 Regards, Gabriel
5064
Age (days ago)
5066
Last active (days ago)
5 comments
6 participants
participants (6)
-
Alan G Isaac
-
Benjamin Root
-
Gabriel Mihalache
-
Gökhan Sever
-
Jon Wright
-
Sebastian Haase