Velocity Reviews > Multidimensional arrays - howto?

# Multidimensional arrays - howto?

doodle4@gmail.com
Guest
Posts: n/a

 02-14-2005
Hello all,

I am trying to convert some C code into python. Since i am new to
python, i would like to know how to deal with multidimensional arrays?

Thanks,
-Joe

Here's a snippet of what i am trying to convert:

# define table0 15
# define table1 20

unsigned int Table[table0][table1]

if(Table[table0][table1] != 0)
{
Table[table0][table1]--
}

Daniel Yoo
Guest
Posts: n/a

 02-14-2005
http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:
: Hello all,

: I am trying to convert some C code into python. Since i am new to
: python, i would like to know how to deal with multidimensional arrays?

Here you go:

http://python.org/doc/faq/programmin...mensional-list

Also, if your table is relatively sparse, you might even be able to
use a dictionary, because a 2-d array can be considered as a mapping
between (index1, index2) keys and its values.

Fredrik Lundh
Guest
Posts: n/a

 02-14-2005
<(E-Mail Removed)> wrote:

> I am trying to convert some C code into python. Since i am new to
> python, i would like to know how to deal with multidimensional arrays?

http://www.python.org/doc/faq/progra...mensional-list

</F>

Colin J. Williams
Guest
Posts: n/a

 02-16-2005
(E-Mail Removed) wrote:
> Hello all,
>
> I am trying to convert some C code into python. Since i am new to
> python, i would like to know how to deal with multidimensional arrays?
>
> Thanks,
> -Joe
>
> Here's a snippet of what i am trying to convert:
>
> # define table0 15
> # define table1 20
>
> unsigned int Table[table0][table1]
>
> if(Table[table0][table1] != 0)
> {
> Table[table0][table1]--
> }
>

from Source Forge and intended for numeric and other arrays.

Colin W.