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

Alan G Isaac alan.isaac at gmail.com
Wed Sep 28 23:09:35 EDT 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.)

Thanks,
Alan Isaac



More information about the NumPy-Discussion mailing list