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

Alan G Isaac alan.isaac@gmail....
Wed Sep 28 22:09:35 CDT 2011

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.)

Alan Isaac

More information about the NumPy-Discussion mailing list