SunQuest
           Python Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesPython Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here!
  #1  
Old July 5th, 2003, 01:38 PM
liechmaster liechmaster is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Warsaw , Poland
Posts: 1 liechmaster User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
multi arrays in python

hi,
i need to create a multi array (matrix) and i have no idea how to do it :/ i have a variable named x and i want to create on this variable an array with double index (10x10) of integer.
any1 can halp me? it is possible in python?

Reply With Quote
  #2  
Old July 6th, 2003, 05:47 AM
netytan's Avatar
netytan netytan is offline
Hello World :)
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Mar 2003
Location: Hull, UK
Posts: 2,529 netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 17 h 19 m 5 sec
Reputation Power: 63
Send a message via ICQ to netytan Send a message via AIM to netytan Send a message via MSN to netytan Send a message via Yahoo to netytan
Your gonna have to give me a little more info about what your trying to do, if you mean an array within an array then..

Code:
array = [[1, 2],[3, 4],[5, 6],[7, 8],[9, 10],[11, 12],[13, 14]]


you can stick as many arrays of any value inside other array as you like. and access them in the same way i.e to get the value 1 you would use array[0][1] and so on.

Oh, future ref' an array in Python is called a list

Hope this helps,
Mark.

Reply With Quote
  #3  
Old July 10th, 2003, 06:20 PM
inkedmn inkedmn is offline
Tattooed Python-Lovin' Freak-Boy
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2001
Location: orange county, CA
Posts: 16 inkedmn User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to inkedmn Send a message via AIM to inkedmn
actually, there is an array module in python's standard library, but it only holds one datatype (like arrays in java/c/c++)

but, multidimentional lists aren't builtin to python, but they can be created/indexed easily enough

Reply With Quote
  #4  
Old July 11th, 2003, 09:28 AM
shochu shochu is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 6 shochu User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
You probably want to use the the Numeric module which has an array type built in just for creating and manipulating matrices.

Actually this is the link to numarray which is the newer module which is going to be phasing out Numeric.

It's much faster than using lists to represent matrices and much more memory efficient, lists are memory hogs. Also it has tons of built in functions to help you manipulate matrices.

Hope this helps.


http://pfdubois.com/numpy/

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPython Programming > multi arrays in python


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway