Creating multi-dimensional arrays
Kirill Simonov
kirill at xyz.donetsk.ua
Thu Aug 9 23:18:30 EDT 2001
More information about the Python-list mailing list
Thu Aug 9 23:18:30 EDT 2001
- Previous message (by thread): Creating multi-dimensional arrays
- Next message (by thread): How to call java from python?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Wed, Aug 08, 2001 at 08:55:21AM +0000, spam_buster_2000 at yahoo.com wrote: > I've been writing a couple of programs recently which use multi-dimensional arrays of > a predefined size, and I was wondering if there was a standard idiomatic way of creating > these in Python. I'm not looking to restrict the arrays to contain specific types, so just > pointing me to Numeric isn't the answer here. You can use dictionaries instead of nested lists: a = {} for i in range(10): for j in range(10): for k in range(10): a[i,j,k] = 0
- Previous message (by thread): Creating multi-dimensional arrays
- Next message (by thread): How to call java from python?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list