[Numpy-discussion] ndarray of matrices

Alexandre Guimond alexandre.guimond at mirada-solutions.com
Thu Jun 8 05:39:00 CDT 2006


Hi all.

 

i work mainly with "volume" (3d) images, and numpy.ndarray answers most
of my needs (addition of images, etc.). The problem I'm faced now with
is that I have images of matrices and vectors and would like that when I
do image_of_matrices * image_of_vector is does the dot product of each
of my matrices with all of my vectors, and when I do
image_of_matrices.mean() it gives me the mean matrix. Basically, I want
the same functionalities that are currently provided with scalars, but
applied to matrices.

 

It seems that a nice way of doing this is to have and ndarray of
numpy.matrix, but this isn't supported it seems. Can anyone recommend a
good way of implementing this? I'm new with the numpy thing and I'm not
sure if subclassing ndarray is a good idea since I'll have to overload
all the operators and i don't believe this will result in a very fast
implementation, but I might be mistaken. Another possibility may be to
create a new dtype for numpy.matrix, but I don't know if this is
possible. Anyone have recommandations?

 

Thx for any help.

 

Alex.



NOTICE: This e-mail message and all attachments
transmitted with it may contain legally privileged and
confidential information intended solely for the use of
the addressee. If the reader of this message is not the
intended recipient, you are hereby notified that any
reading, dissemination, distribution, copying, or other
use of this message or its attachments, hyperlinks, or
any other files of any kind is strictly prohibited. If you
have received this message in error, please notify the
sender immediately by telephone (+44-1865-265500) or by
a reply to this electronic mail message and delete this
message and all copies and backups thereof.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/numpy-discussion/attachments/20060608/d2d44ac7/attachment.html 


More information about the Numpy-discussion mailing list