[英]How to suppress scientific notation in values in a pandas dataframe?
I have pandas.DataFrame
that contains some values with scientific notation and I want to change those values to a normal value without the e+..
.我有pandas.DataFrame
包含一些带有科学计数法的值,我想在没有e+..
的情况下将这些值更改为正常值。
import pandas as pd
df = pd.DataFrame(
[7.70000e+05, 4.5000000e+09, 3.219500e+05, 25000, 476577],
columns = ['Price'])
You can try something like this:你可以尝试这样的事情:
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
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.