1、查看DataFrame的数据类型

df.dtypes#查看各列数据类型
df[A].dtypes#查看A列数据类型

2、转换DataFrame的数据类型

df[A].astypes(int)#将A列数据类型转换为int

data['note_n'] = pd.to_numeric(data['note_n'])

traindata=pd.DataFrame(traindata,dtype=np.float)

相关文章:

  • 2022-12-23
  • 2021-06-25
  • 2022-12-23
  • 2021-10-18
  • 2022-12-23
  • 2022-12-23
  • 2021-09-26
  • 2022-12-23
猜你喜欢
  • 2021-12-22
  • 2021-11-28
  • 2021-10-11
  • 2021-10-13
  • 2022-12-23
  • 2021-04-19
  • 2022-12-23
相关资源
相似解决方案