[Numpy-discussion] .M .A .T .H attribute result

Keith Goodman kwgoodman at gmail.com
Mon Jul 10 13:30:09 CDT 2006


On 7/7/06, Travis Oliphant <oliphant at ee.byu.edu> wrote:

> a numpy.matlib  module was started to store matrix versions of the
> standard array-creation functions and mat was re-labeled to "asmatrix"
> so that a copy is not made by default.

Holy crap! It works. This is great. Thank you.

>> import numpy.matlib

>> numpy.__version__
'0.9.9.2788'

>> from numpy.matlib import *

>> rand(2,2)

matrix([[ 0.23834437,  0.60329722],    <--- matrix by default
        [ 0.03907811,  0.55134035]])

>> ones((2,2))

matrix([[ 1.,  1.],    <--- matrix by default
        [ 1.,  1.]])

>> numpy.matlib.
numpy.matlib.N                 numpy.matlib.__name__          numpy.matlib.eye
numpy.matlib.__all__           numpy.matlib.__new__
numpy.matlib.identity
numpy.matlib.__class__         numpy.matlib.__reduce__
numpy.matlib.matrix
numpy.matlib.__delattr__       numpy.matlib.__reduce_ex__
numpy.matlib.ndarray
numpy.matlib.__dict__          numpy.matlib.__repr__          numpy.matlib.ones
numpy.matlib.__doc__           numpy.matlib.__setattr__       numpy.matlib.rand
numpy.matlib.__file__          numpy.matlib.__str__           numpy.matlib.randn
numpy.matlib.__getattribute__  numpy.matlib.array             numpy.matlib.zeros
numpy.matlib.__hash__          numpy.matlib.asmatrix
numpy.matlib.__init__          numpy.matlib.empty




More information about the Numpy-discussion mailing list