Re: determinant



Tuvas wrote:
> I am trying to find a nice function that quickly determines the
> determanant in python. Anyone have any recommendations? I've heard
> about numpy, but I can't get it to work (It doesn't seem to like the
> import Matrix statement...). Thanks!

That's a new one on me. Have you tried the latest release of numpy?

http://sourceforge.net/project/showfiles.php?group_id=1369&package_id=175103

If that still doesn't work for you, then please come to the numpy-discussion
list so we can figure out why it won't build for you. We will need to know
things like your platform, your compiler, and the actual text of the errors that
you are seeing.

http://lists.sourceforge.net/lists/listinfo/numpy-discussion

But once you have it installed:

In [29]: A
Out[29]:
array([[0, 1],
[2, 3]])

In [30]: numpy.linalg.det(A)
Out[30]: -2.0

--
Robert Kern
robert.kern@xxxxxxxxx

"In the fields of hell where the grass grows high
Are the graves of dreams allowed to die."
-- Richard Harter

.



Relevant Pages

  • Re: determinant
    ... > determanant in python. ... Anyone have any recommendations? ... > about numpy, but I can't get it to work (It doesn't seem to like the ...
    (comp.lang.python)
  • determinant
    ... determanant in python. ... Anyone have any recommendations? ... about numpy, but I can't get it to work (It doesn't seem to like the ...
    (comp.lang.python)
  • Re: Reading Fortran Data
    ... am currently getting acquainted with Python and, in particular SciPy, ... NumPy, and Matplotlib. ... Fortran. ... this in Python is to use string formating with a given width. ...
    (comp.lang.python)
  • Re: Re: maximum value in a column of file
    ... I was trying to do this by using python, that the reason why i tried to use numpy. ... extract value from line ... ...
    (comp.lang.python)
  • Re: switching to numpy and failing, a user story
    ... switch a large codebase (python and C++) to using numpy. ... numpy/scipy mailing lists (else you used a different name or email, ...
    (comp.lang.python)