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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.