0

First, let me say that I've seen --

Format / Suppress Scientific Notation from Python Pandas Aggregation Results

and tried those things that are mentioned in this question as you can see below, and yet I get the same e+ notation.

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

test_df.median().values

array([-1.2e+02,  3.4e+01,  2.9e+01,  2.1e+03,  4.4e+02,  1.2e+03,
        4.1e+02,  3.5e+00,  1.8e+05,  3.0e+00])

OR

pd.set_option('display.float_format', lambda x: '%.2f' % x)

test_df.median().values

array([-1.2e+02,  3.4e+01,  2.9e+01,  2.1e+03,  4.4e+02,  1.2e+03,
        4.1e+02,  3.5e+00,  1.8e+05,  3.0e+00])

How do I get the floats in the array ex. 2.9e+01 as 29. etc.

I don't want to see output in scientific format by default, unless I explicitly set it.

Onkar N Mahajan
  • 410
  • 3
  • 13

0 Answers0