MEHMET BALIOGLU

How to Get Rid of the “e Notation” in Pandas Dataframe?

Get rid of e notation

I’m now going to show you how to get rid of this “e letter” or “e notation” in your pandas dataframe, with using one line of code. So easy.

import pandas as pd
d = {'col1': [0.0000801023, 2458983048083]}
df = pd.DataFrame(data=d)
print(df)
                      col1
0  8.010230e-05
1  2.458983e+12

Just add one line of code:

import pandas as pd
#just add this to the top, after the imports
pd.options.display.float_format = '{:.10f}'.format
d = {'col1': [0.0000801023, 0.2458983048]}
df = pd.DataFrame(data=d)
print(df)

                       col1
0 0.0000801023
1 0.2458983048

All sorted.

What is E Notation?

Scientific notation is a way of writing very large or very small numbers. A number is written in scientific notation when a number between 1 and 10 is multiplied by a power of 10. For example, 650,000,000 can be written in scientific notation as 6.5 ✕ 10^8.
Because superscripted exponents like 107 cannot always be conveniently displayed, the letter E (or e) is often used to represent “times ten raised to the power of” (which would be written as “× 10n“) 
Although the E stands for exponent, the notation is usually referred to as (scientific) E notation rather than (scientific) exponential notation. The use of E notation facilitates data entry and readability in textual communication since it minimizes keystrokes, avoids reduced font sizes and provides a simpler and more concise display.