繁体   English   中英

使用pandas.read_excel读取excel时转换科学记数法(十进制字母)

[英]Convert scientific notation (letters in decimal values) when reading excel with pandas.read_excel

我有一个 excel 文档,其值类似于: 0.0000595628

当我使用print(float(row['% of total failures2'])) ,我得到值5.95628e-05

即使仅使用print(row['% of total failures2'])阅读它,我也得到相同的5.95628e-05

如何转换该值以显示其所有小数? 原因是因为当我尝试在 teradata 中插入值时,该列是一个字符串,它将按原样插入。

在此处输入图片说明

更新:即使我在 excel 中将列更改为 Number,我5.95628e-05得到相同的结果: 5.95628e-05

在此处输入图片说明

将行值转换为小数点后 10 位

row['% of total failures2'] = "{:.10f}".format(float(row['% of total failures2']))

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM