determinant

Robert Kern robert.kern at gmail.com
Tue Jan 31 01:06:44 EST 2006


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 at gmail.com

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




More information about the Python-list mailing list