user873288
user873288

Reputation: 13

can anyone explain me these pandas code, Im looking at a EDA project on a Banking Data

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

Answers (1)

K0mp0t
K0mp0t

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

Related Questions