df = df.round(decimals=6).astype(object)
转换为
object将允许混合表示。但是,请记住,从性能角度来看,这不是很有用。
dfA B0 0.149724 -0.7703521 0.606370 -1.1945572 10.000000 10.0000003 10.000000 10.0000004 0.843729 -1.5716385 -0.427478 -2.0285066 -0.583209 1.1142797 -0.437896 0.9293678 -1.025460 1.1561079 0.535074 1.085753df.round(6).astype(object) A B0 0.149724 -0.7703521 0.60637 -1.194562 10 103 10 104 0.843729 -1.571645 -0.427478 -2.028516 -0.583209 1.114287 -0.437896 0.9293678 -1.02546 1.156119 0.535074 1.08575



