In this post, we will see how to resolve formatting .dscribe() output in python
Question:
descirbe() output the method I used is belowI also have another question
could anyone explain to me
pd.set_option('display.float_format', lambda x: '%.5f' % x)
lambda x: ‘%.5f’ % x what’s this mean?and
.apply("{0:.5f}".format)
“{0:.5f}”.format what’s this mean?Best Answer:
You can’t pass aSeries
(list like) to str.format
method because Python doesn’t understand how it should process this list.applymap
instead of apply
to transform each individual values (which is not the best choice):pd.set_option
or pd.context_option
(for temporary modification):If you have better answer, please add a comment about this, thank you!
Source: Stackoverflow.com