Boomshakalaka
Boomshakalaka

Reputation: 521

Why python returns scientific notation when calculate in the dataframe?

when I do the calculations in the dataframe using Python, it returns the scientific notations results...Is there method making the results without scientific notations (just return the float)? Those highlighted number should be 0.

enter image description here

Thanks for the help.

Upvotes: 1

Views: 593

Answers (1)

n1tk
n1tk

Reputation: 2500

Option1: You can use one option: display.precision: pd.set_option('precision', 5)

Options and Settings

Option2: You can use float format:

pd.options.display.float_format = '${:,.5f}'.format

Option3: you can use the round:

DataFrame.round(decimals=0, *args, **kwargs) to can round close to the nearest number:

df.round(5) # for whole dataframe

pandas.DataFrame.round

Upvotes: 1

Related Questions