Serdia
Serdia

Reputation: 4428

Why does the `describe` function display floats using scientific notation?

Data in a .csv file looks like this:

enter image description here

But when I am using function describe it shows me numbers in scientific notation?

How can I format them within describe function?

enter image description here

Upvotes: 1

Views: 234

Answers (1)

niraj
niraj

Reputation: 18218

You can try following as mentioned in similar issue:

pd.set_option('float_format',lambda x: "%.6f" % x)

From the document:

display.float_format : callable
    The callable should accept a floating point number and return
    a string with the desired format of the number. This is used
    in some places like SeriesFormatter.
    See formats.format.EngFormatter for an example.
    [default: None] [currently: None]

Upvotes: 2

Related Questions