determinant

T

Tuvas

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!
 
R

Robert Kern

Tuvas said:
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
(e-mail address removed)

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

Tuvas

I am using Windows, using Python 2.4. Perhaps I just did the import
statement wrong? I've never installed a library in Windows before,
perhaps I did something wrong there too.. But anyways, it just doesn't
seem to work. The import statements were:

import Matrix, LinearAlgebra

Neither seem to work. Thanks for the help!
 
T

Tuvas

Never mind, I realized I was using a bit of code way too old. I just
needed to change the import statements to:

import numpy.matrix
import numpy.linalg

Thanks for the help!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
474,283
Messages
2,571,405
Members
48,098
Latest member
inno vation

Latest Threads

Top