'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+..
.
import pandas as pd
df = pd.DataFrame(
[7.70000e+05, 4.5000000e+09, 3.219500e+05, 25000, 476577],
columns = ['Price'])
Solution 1:[1]
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
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Pablo C |