[SciPy-user] I'm a newbie in Python ans SciPy... so i've a little question

Juan Martinez jmartinezs@sii...
Thu Jan 10 08:34:14 CST 2008


Hello Everybody:
 
I'm a newbie user of Scipy, and i try to get a determinant of a matrix, but
the matrix object is modified for the method det() of linalg
 
A little piece of with example..
 
CODE
 
#!/usr/bin/env python
# coding: latin-1
 
# Modules import
from numarray import *
from scipy.linalg import *
 
ar = array([[4.0, -2.0, 1.0], \
            [-2.0, 4.0, -2.0], \
            [1.0, -2.0, 3.0]])
print 'Before det() ar = \n', ar
 
print det(ar)                                                     # Get
determinant of ar
print 'After det() ar = \n', ar
 
END CODE
 
 
ON SCREEN
 
Before det() ar = 
[[ 4. -2.  1.]
 [-2.  4. -2.]
 [ 1. -2.  3.]]
After det() ar = 
[[ 4.   -0.5   0.25]
 [-2.    3.   -0.5 ]
 [ 1.   -1.5   2.  ]]
 
END OUTPUT
 
Please, help me to know what i'm doing wrong.
 
Thank you in advance
 
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/scipy-user/attachments/20080110/4a4b5faa/attachment.html 


More information about the SciPy-user mailing list