Specifying dtype float32 with pandas.read_csv on pandas 0.10.1

后端 未结 2 1300
忘了有多久
忘了有多久 2020-12-17 07:24

I\'m attempting to read a simple space-separated file with pandas read_csv method. However, pandas doesn\'t seem to be obeying my dtype argument.

2条回答
  •  北荒
    北荒 (楼主)
    2020-12-17 08:10

    In [22]: df.a.dtype = pd.np.float32
    
    In [23]: df.a.dtype
    Out[23]: dtype('float32')
    

    the above works fine for me under pandas 0.10.1

提交回复
热议问题