小编Mar*_*arK的帖子

如何将 Pandas 中的所有 float64 列转换为 float32?

有没有一种通用方法可以将 pandas 数据框中的所有 float64 值转换为 float32 值?但不将 uint16 更改为 float32?我事先不知道信号名称,但只想没有 float64。

就像是:

if float64, then convert to float32, else nothing?
Run Code Online (Sandbox Code Playgroud)

数据的结构是:

DF.dtypes

Counter               uint16
p_007                 float64
p_006                 float64
p_005                 float64
p_004                 float64
Run Code Online (Sandbox Code Playgroud)

python type-conversion pandas dtype

13
推荐指数
2
解决办法
2万
查看次数

标签 统计

dtype ×1

pandas ×1

python ×1

type-conversion ×1