array of array of float

tac-tics tactics40 at gmail.com
Sun Jul 9 16:35:44 EDT 2006


Use nested list comprehensions:

matrix = [[0.0 for x in xrange(n)] for y in xrange(m)]

This is similar to "float matrix[m][n]" in C.

All cells are independent of each other in doing this.




More information about the Python-list mailing list