Practical Business Python

Taking care of business, one python script at a time

Mon 04 May 2015

Tips for Customizing Your IPython and Pandas Display

Posted by Chris Moffitt in articles   

Introduction

The combination of IPython + Jupyter + Pandas makes it easy to interact with and display your data. Not surprisingly, these tools are easy to customize and configure for your own needs. This article summarizes some of the most useful and interesting options.

For this particular post, I will show the detailed examples in a Notebook since it is easiest to see and simple to share. Feel free to review and post any comments or questions below.

If you would like to download the dataset and follow along, it’s here.

Topics Covered

Please see the Notebook for all the examples but here’s a quick summary of the various options and commands I cover.

  • Overriding the default CSS of your notebook using IPython.core.display
  • Displaying arbitrary variables with IPython.display
  • Using several different pandas options including
    • display.max_rows
    • display.max_columns
    • precision
    • float_format
  • Demo of the third party plugin - qgrid
  • Using Matplotlib styles to improve your plots

Wrapping It Up

If you have any comments or suggestions for other tips to include feel free to add them in the comments below. Also, I’m interested to hear if people like this format consisting of a short post with longer notebooks as compared to the style of my previous articles. I’m always looking for feedback and ideas for future discussion.

Comments