Multidimensional arrays - howto?

Daniel Yoo dyoo at hkn.eecs.berkeley.edu
Mon Feb 14 18:28:10 EST 2005


doodle4 at gmail.com 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/programming.html#how-do-i-create-a-multidimensional-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.



More information about the Python-list mailing list