DS-100 / textbook

Learning Data Science, a textbook.
https://learningds.org/
Other
235 stars 82 forks source link

Time to set `pd.set_option('precision', 2)` to `pd.set_option('display.precision', 2)? #172

Open matthew-brett opened 8 months ago

matthew-brett commented 8 months ago

I noticed a couple of places at least where y'all have:

pd.set_option('precision', 2)

or equivalent - see e.g.:

https://ds.lis.2i2c.cloud/hub/user-redirect/git-pull?repo=https%3A//github.com/lisds/ds-100-sql&subPath=content/ch/07/sql_exercises.ipynb)

With current Pandas, this gives:

OptionError: Pattern matched multiple keys

I assume you intend this to mean display.precision instead of styler.format.precision? But in either case, is now the time to specify the option explicitly? Happy to make a PR if so.

SamLau95 commented 8 months ago

Yup, we were using an older version of pandas while working on the book, and we should update our option key here.