[Numpy-discussion] Unexpected conversion from matrix to array

Keith Goodman kwgoodman@gmail....
Wed Dec 5 12:30:44 CST 2007


>> import numpy.matlib as M
>> x = M.asmatrix(['a', 'b', 'c'])
>> x == 'a'
array([[ True, False, False]], dtype=bool)   #  <---- I expected a matrix

>> x = M.asmatrix([1, 2, 3])
>> x == 1
matrix([[ True, False, False]], dtype=bool)  #  <---- This looks good
>>
>> M.__version__
'1.0.5.dev4445'


More information about the Numpy-discussion mailing list