如何在大多数数据帧值中抑制科学记数法?

时间:2021-03-11 22:24:23

标签: python pandas

我有包含一些带有科学记数法的值的数据框,我想将这些值更改为没有 e+ 的正常值..

import pandas as pd
df = pd.DataFrame([7.70000e+05,4.5000000e+09,3.219500e+05,25000,476577], 
         columns =['Price'])

1 个答案:

答案 0 :(得分:0)

你可以试试这样的:

pd.set_option("float_format", lambda x: f"{x:.2f}")
df
          Price
0     770000.00
1 4500000000.00
2     321950.00
3      25000.00
4     476577.00