Suppress Scientific Format in a Dataframe Column

iprof0214 picture iprof0214 · Apr 19, 2018 · Viewed 22.1k times · Source

I have a column called accountnumber with values similar to 4.11889000e+11 in a pandas dataframe. I want to suppress the scientific notation and convert the values to 4118890000. I have tried the following method and did not work.

df = pd.read_csv(data.csv)
pd.options.display.float_format = '{:,.3f}'.format

Please recommend.

Answer

user1319128 picture user1319128 · Apr 19, 2018

You don't need the thousand separators "," and the 3 decimals for the account numbers.

Use the following instead.

pd.options.display.float_format = '{:.0f}'.format