Error in linalg.inv ??

2009-06-06 Thread Ajith Kumar
Hello, I ran the following code (Using Debian 5.0) from numpy import * a = arange(1.,10.) b = reshape(a, [3,3]) c = linalg.inv(b) print b print c print dot(b,c) print dot(c,b) And the result is [[ 1. 2. 3.] [ 4. 5. 6.] [ 7. 8. 9.]] [[ 3.15221191e+15 -6.30442381e+15 3.15221191e+15] [

Re: Error in linalg.inv ??

2009-06-06 Thread John Machin
On Jun 6, 3:34 pm, Ajith Kumar aj...@iuac.res.in wrote: Hello,  I ran the following code (Using Debian 5.0) from numpy import * a = arange(1.,10.) b = reshape(a, [3,3]) c = linalg.inv(b) print b print c print dot(b,c) print dot(c,b) And the result is [[ 1.  2.  3.]  [ 4.  5.  6.]  

Re: Error in linalg.inv ??

2009-06-06 Thread Nick Craig-Wood
Ajith Kumar aj...@iuac.res.in wrote: I ran the following code (Using Debian 5.0) from numpy import * a = arange(1.,10.) b = reshape(a, [3,3]) c = linalg.inv(b) print b print c print dot(b,c) print dot(c,b) And the result is [[ 1. 2. 3.] [ 4. 5. 6.] [ 7. 8.

Re: Error in linalg.inv ??

2009-06-06 Thread Robert Kern
On 2009-06-06 00:34, Ajith Kumar wrote: Hello, I ran the following code (Using Debian 5.0) from numpy import * Please ask numpy questions on the numpy mailing list, not here: http://www.scipy.org/Mailing_Lists a = arange(1.,10.) b = reshape(a, [3,3]) c = linalg.inv(b) print b print c

Re: Error in linalg.inv ??

2009-06-06 Thread Terry Reedy
Ajith Kumar wrote: [[ 1. 2. 3.] [ 4. 5. 6.] [ 7. 8. 9.]] Another way to see that this is singular is notice or calculate that (1,2,3) - 2*(4,5,6) + (7,8,9) = (0,0,0) Same is true for the columns. -- http://mail.python.org/mailman/listinfo/python-list

Re: Error in linalg.inv ??

2009-06-06 Thread John Machin
Robert Kern robert.kern at gmail.com writes: On 2009-06-06 00:34, Ajith Kumar wrote: from numpy import * Please ask numpy questions on the numpy mailing list, not here: http://www.scipy.org/Mailing_Lists a = arange(1.,10.) b = reshape(a, [3,3]) c = linalg.inv(b) And the

Re: Error in linalg.inv ??

2009-06-06 Thread Carl Banks
On Jun 6, 3:31 pm, Robert Kern robert.k...@gmail.com wrote: On 2009-06-06 17:09, John Machin wrote: Robert Kernrobert.kernat  gmail.com  writes: You have a very singular matrix (2*a[1] - a[0] == a[2]). You cannot invert it numerically and expect sensible results. Is raising an