pandas icon indicating copy to clipboard operation
pandas copied to clipboard

DataMatrix constructor ignores dtype argument if data is a DataMatrix

Open andylei opened this issue 16 years ago • 3 comments

>>> a = DataMatrix([[1.0,2.0,3.0],[4.0,5.0,6.0]], range(2), range(3))
>>> b = DataMatrix(a, dtype=int)
>>> b.values.dtype
dtype('float64')

Not sure if this was a design decision or not, but it seems like the dtype of b.values should be int.

andylei avatar Sep 29 '10 15:09 andylei

This is a bug. DataMatrix as input to the DataMatrix constructor was added only very recently and I overlooked the case you gave.

wesm avatar Sep 30 '10 02:09 wesm

I've noticed a similar issue when using the dictionary constructor.

hector13 avatar Oct 03 '10 17:10 hector13

should be fixed in git HEAD

wesm avatar Dec 11 '10 06:12 wesm