[Numpy-discussion] should the return type of matlib.reshape be ndarray or matrix?

Charles R Harris charlesr.harris at gmail.com
Sat Oct 1 22:59:09 EDT 2011


On Wed, Sep 28, 2011 at 9:09 PM, Alan G Isaac <alan.isaac at gmail.com> wrote:

> Is this the intended behavior?
>
>     >>> from numpy import matlib
>     >>> m = matlib.reshape([1,2],(2,1))
>     >>> type(m)
>     <type 'numpy.ndarray'>
>
> For any 2d shape, I expected a matrix.
> (And probably an exception if the shape is not 2d.)
>
>
I think you are right.

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20111001/83f8d991/attachment.html>


More information about the NumPy-Discussion mailing list