[Tutor] Table or Matrix Whatever

Robin B. Lake rbl@hal.cwru.edu
Thu, 6 Apr 2000 06:34:25 -0400 (EDT)


> Hi all again! :)
> 
> I would like to know how can i creat a table or matrix. I need to store
> datas like:
> 
>         1         2        3
> q1      a         b       a,b
> q2      b         a        a
>
Because there is one element that is a tuple, I would guess that
you would want to create your table/matrix tuple-capable.  And
assuming you will want to CHANGE the matrix elements at some time,
I'd check which Python structures are mutable.

I would first try a dict[ ] structure, using the (qn, n) matrix index
as the index for the dict.

Then I'd look at some dict examples to see how best to access the elements.

I'm not at the office yet, so I can't look up the answers (nor have I
had my caffeination yet) ...

Cheers,
Rob Lake
rbl@hal.cwru.edu

 
> And how can i acess the datas from table like:
> test[2][2]=a
> 
> I think that is it!
> Thanks for any help
>