pandas always cast column to object even if column contains only integer

前端 未结 0 1605
伪装坚强ぢ
伪装坚强ぢ 2021-01-17 07:07

I try this one:

pd.DataFrame(numpy.array([[1, 2, 3], [4, 5, 6], [7, \'a\', \'b\']]), columns=[\'a\', \'b\', \'c\']).dtypes

a    object
b    object
c    objec         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题