[Tutor] Two-Dimensional arrays

Martijn Faassen M.Faassen@vet.uu.nl
Tue, 03 Aug 1999 16:16:36 +0200


Deirdre Saoirse wrote:
> 
> I have a problem that needs two-dimensional arrays, but NumPy really seems
> like overkill. I had solved it another way, then realized I really
> *needed* two-dimensional arrays.

Will an array of arrays do, then?
 
> Here's my constraints (for a knitwear design project I'm working on):
> 
> 1) typically an array will contain between 10k and 50k elements. Each
> element will have a stitch attribute and a color attribute (think two
> bytes).

Okay, so your arrays are big but each element is of the same type. I'd
suggest you look into the array module for this. 

> 2) the most mathematically advanced thing I need to do with the elements
> is copy one row to the next (and apply patterning, which I don't expect to
> do for a while).

My knowledge of knitwear is absent. But it looks like a Python list of
array modules could do the trick.

Regards,

Martijn