473,770 Members | 6,158 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

determinant

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!

Jan 31 '06 #1
4 8891
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/showf...kage_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/l...mpy-discussion

But once you have it installed:

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

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

--
Robert Kern
ro*********@gma il.com

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

Jan 31 '06 #2
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!

Jan 31 '06 #3
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!

Jan 31 '06 #4
[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!


http://aspn.activestate.com/ASPN/Coo.../Recipe/189971

Jan 31 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3141
by: MLH | last post by:
Just didn't wann reinvent the rolly thing.
2
10610
by: aruna | last post by:
i want a c program to find the determinant of matrix and inverse of matrix as two separate c programs . please help me
1
3322
by: naren | last post by:
can anyone help with the code for determinant,cofactor and inverse of a matrix in c++ lang? i am not getting the logic.....
5
5837
by: Aanz | last post by:
I read the previous messages , but was unable to comprehend them in terms of programming. Kindly, guide me through proper and orgranize way.
1
5656
by: avdhoot | last post by:
Hi Everybody, I am doing some project in VB6 where I ahve to calculate the Determinant of the matrix. I have got a function MDETERM but not able to pass on the parameters of the matrix and get the result. Can any body tell me how to get the result of this. I am using a 3x3 matrix. Code with example is highly appriciated......
14
7130
by: James Stroud | last post by:
Hello All, I'm using numpy to calculate determinants of matrices that look like this (13x13):
2
4041
by: pvsgangadhar | last post by:
I need the program in c-langauge to find the determinant of a matrix for specified no.or rows and columns.
1
4460
by: haderika | last post by:
Hey, I'm having trouble overloading the ~ operator (the determinant of the matrix) in a case of 2x2 matrices. So i have a matrix class, with the constructor, overloading +, += and ~ operators. the first two are working but I don't know how to overload the ~ one. here's what I have: matrix matrix::operator~(matrix &m) { double x; x=(m.a11*m.a22)-(m.a12*m.a21); return x; of course it's not working cause i can't return a double value...
0
9592
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9425
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10005
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9871
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8887
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7416
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5452
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3972
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2817
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.