Two-dimensional array tutorial?
Diez B. Roggisch
deets at nospam.web.de
Wed Oct 22 16:05:07 CEST 2008
Martin Schneider wrote:
> I'd like to handle two-dimensional arrays. My first choice, the numpy
> library, doesn't seem to be an option due to compatibility issues (see
> my other thread about python22.dll).
> Is there a tutorial somewhere how to handle 2d-arrays with vanilla Python?
there isn't much to them, simply create an use:
foo = [[0 for _ in xrange(height)] for _ in xrange(width)]
or something similar. Then you just use
to access individual elements.
Alternatively, you can use the module "array" for the inner list to be more
Obviously you don't get any further operations on arrays such as
transposition, multiplication and the like.
Can't you just get Numpy (or it's predecessors, Numeric) compiled against
More information about the Python-list