I have the following dataframe, while using jupyter notebook on win10.
d = {'col1': [1000000, 200000000000000], 'col2': [3, 4]}
df2 = pd.DataFrame(data=d)
df2.describe()
which leads to the following output:
col1 col2
count 2.000000e+00 2.000000
mean 1.000000e+14 3.500000
std 1.414214e+14 0.707107
min 1.000000e+06 3.000000
25% 5.000000e+13 3.250000
50% 1.000000e+14 3.500000
75% 1.500000e+14 3.750000
max 2.000000e+14 4.000000
I know it is only a 'optical' isssue but somehow I dislike it, when the first row does not have the same number format, it is not super easy to compare it. Is there a way to avoid this displaying and instead have the output, somehow python use the same format for the column and not for the row right?:
col1 col2
count 2.000000 2.000000
mean 1.000000e+14 3.500000
std 1.414214e+14 0.707107
min 1.000000e+06 3.000000
25% 5.000000e+13 3.250000
50% 1.000000e+14 3.500000
75% 1.500000e+14 3.750000
max 2.000000e+14 4.000000
Or is it maybe possible to have the same format per row instead of column?
Can I only change the float display for all together? In this way: Customized float formatting in a pandas DataFrame , or can pandas do it in a smart way?