[Numpy-discussion] matrix vs. array

Bill Baxter wbaxter at gmail.com
Tue Mar 14 19:09:02 EST 2006


Inspect is a really handy python module:
     import inspect
     import numpy
     print inspect.getsource(numpy.matrix)

>From that it looks like exponentiation (__pow__) is also overloaded, and
there are the additional properties:
.A - get the array
.T - get the transpose
.H - get the conjugate transpose
.I - get the inverse

The other difference which isn't really obvious from looking at the source
code is that matrices always have at least rank 2.  I.e. .shape[0] and
.shape[1] are always present for a matrix.

--bb


On 3/15/06, Ryan Krauss <ryanlists at gmail.com> wrote:
>
> Is there a difference between matrix and array objects other than how
> they handle multiplication?  Is there documentation somewhere about
> matrix objects?  Are they new?
>
> Thanks,
>
> Ryan
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by xPML, a groundbreaking scripting
> language
> that extends applications into web and mobile media. Attend the live
> webcast
> and join the prime developer group breaking into this new coding
> territory!
> http://sel.as-us.falkag.net/sel?cmdlnk&kid0944&bid$1720&dat1642
> _______________________________________________
> Numpy-discussion mailing list
> Numpy-discussion at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/numpy-discussion
>



--
William V. Baxter III
OLM Digital
Kono Dens Building Rm 302
1-8-8 Wakabayashi Setagaya-ku
Tokyo, Japan  154-0023
+81 (3) 3422-3380
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20060314/69b8478f/attachment.html>


More information about the NumPy-Discussion mailing list