Reputation: 13
pd.set_option("precision", 2)
pd.options.display.float_format = '{:.2f}'.format
Im not able to figure out what these code line do
Upvotes: 1
Views: 33
Reputation: 99
These code lines fix float numbers precision to two decimal places for pandas output. I belive it's done because your data is banking data, which contains a lot of different money amounts, which should be displayed with 2 decimal places (because there are 100 cents in a dollar)
Upvotes: 1