Numpy/Scipy set field of matrix?

Marc 'BlackJack' Rintsch bj_666 at gmx.net
Tue Sep 2 17:09:09 EDT 2008


On Tue, 02 Sep 2008 13:27:06 -0700, cnb wrote:

>>>> m
> matrix([[1, 2, 3],
>         [4, 5, 6],
>         [7, 8, 9]])
> 
> how do I set the field 1,2 (=6) to 45 for example?
> 
> 
> and how do I initialize a matrix and then add values in a for-loop?
> 
> Im using PIL and want to store all the pixels of an image in a matrix.
> 
> But I can't find the appropriate operations.

Work through the tutorial in the Python documentation and read some 
introduction to Numpy.

Ciao,
	Marc 'BlackJack' Rintsch



More information about the Python-list mailing list