13 Configuring pandas

This chapter covers

  • Configuring pandas display settings for both the Notebook and single cells
  • Limiting the number of printed DataFrame rows and columns
  • Altering the precision of decimal-point numbers
  • Truncating a cell’s text content
  • Rounding numeric values when they fall below a floor

As we’ve worked through the book’s data sets, we’ve seen how pandas improves our user experience by making sensible decisions on data presentation. When we output a 1,000-row DataFrame, for example, the library assumes that we’d prefer to see 30 rows from the beginning and end rather than the whole data set, which can clutter the screen. Sometimes, we may want to break from pandas’ assumptions and alter its settings to fit our custom display ...

Get Pandas in Action now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.