Laszlo Nagy wrote: >># shouldn't I be able to fill the lists simply by pointing to a location? >> >>matrix[a_idx, p_idx] = 0x219 # and so on? >> > > Lists are not matrices. For example: > > L = [ [1,2,3], ['a','b','c'], 10 ] > print L[1][2] # Prints 'c', you will like this syntax but... > print L[2][5] # TypeError: 10 is not subscriptable > > You can create a function that creates a "list of lists" filled with > zeros, and then use this data structure as a matrix. > > BUT! If you need to use matrices filled with numbers, try numarray: > > http://www.stsci.edu/resources/software_hardware/numarray > > Numarray is much more efficient for this task.
It is also out-dated. For new code users are strongly encouraged to use NumPy. The numarray people are transitioning their own code to use NumPy and numarray will cease being supported at some point. http://numpy.scipy.org http://www.numpy.org --- sourceforge site. -Travis -- http://mail.python.org/mailman/listinfo/python-list