有没有一种通用方法可以将 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)