2D lists
Manuel M. Garcia
mgarcia at cole-switches.com
Mon Jan 20 16:48:21 EST 2003
More information about the Python-list mailing list
Mon Jan 20 16:48:21 EST 2003
- Previous message (by thread): 2D lists
- Next message (by thread): 2D lists
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Mon, 20 Jan 2003 12:38:32 +0800, Marcin Matuszkiewicz <marcin at finisar.com> wrote: >What is a most efficient way to create an intialized 2D list? [ [0] * y for _ in range(x) ] is not inefficient. What is your application? For small arrays I would just type it out: [ [0,0], [0,0], [0,0] ] Python is a scripting language, so naive use of Python will not get the same high level of performance you would get if you coded in C or C++. That said, making use of the Numerical Python extensions, you can do many array and matrix operations at C speed. Numerical Python is used by people who wish to do "heavy-duty" numerical analysis in Python. http://www.pfdubois.com/numpy/ Between tools to help you write your own C extension, and new techniques for compiling Python, you should be able to tame any speed critical algorithm. Manuel
- Previous message (by thread): 2D lists
- Next message (by thread): 2D lists
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list