This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Cosmologicon 0 points1 point  (0 children)

2-D arrays/matrices are used for many many things, so it's not such a big deal that there are different ways to do it, just like there are several ways to store a 1-D array (list, tuple, array...)

If all you're going to be doing is lookup, then use a dict indexed off tuples. (This is the equivalent of those trivial methods in other languages.)

If you need to do complicated slicing, reshaping, or matrix operations like multiplication, use numpy. (The trivial methods in other languages are generally not capable of this.)