467,145 Members | 971 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,145 developers. It's quick & easy.

Numpy/Scipy set field of matrix?

cnb
, 'argmax', 'argmin', 'argsort', 'astype', 'base', 'byteswap',
'choose', 'clip', 'compress', 'conj', 'conjugate', 'copy', 'ctypes',
'cumprod', 'cumsum', 'data', 'diagonal', 'dtype', 'dump', 'dumps',
'fill', 'flags', 'flat', 'flatten', 'getA', 'getA1', 'getH', 'getI',
'getT', 'getfield', 'imag', 'item', 'itemset', 'itemsize', 'max',
'mean', 'min', 'nbytes', 'ndim', 'newbyteorder', 'nonzero', 'prod',
'ptp', 'put', 'ravel', 'real', 'repeat', 'reshape', 'resize', 'round',
'searchsorted', 'setfield', 'setflags', 'shape', 'size', 'sort',
'squeeze', 'std', 'strides', 'sum', 'swapaxes', 'take', 'tofile',
'tolist', 'tostring', 'trace', 'transpose', 'var', 'view']
>>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.
Sep 2 '08 #1
  • viewed: 1458
Share:
1 Reply
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
Sep 2 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by jason | last post: by
3 posts views Thread by Iljya | last post: by
15 posts views Thread by greg.landrum@gmail.com | last post: by
2 posts views Thread by robert | last post: by
18 posts views Thread by robert | last post: by
1 post views Thread by Jianzhong Liu | last post: by
5 posts views Thread by auditory | last post: by
1 post views Thread by Michael O'Brien | last post: by
2 posts views Thread by Daniel Nogradi | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.