Exporting an IPython Notebook Dashboard to PDF

In this recipe, you'll learn how to export an IPython Notebook to a PDF file. There are two methods which you can try. If the first works for you, then great, but if it doesn't, then try Method 2.

Getting Ready…

Before attempting a conversion to PDF, add the following line to your ~/.jupyter/jupyter_nbconvert_config.py file. You may need to create this file:

c.ExecutePreprocessor.timeout = 300

This will ensure that a PDF can be generated, and it won't timeout while running the notebook, which can happen, especially if you're importing a few million rows to run through an analysis. Depending on how much data your notebook needs to import before running, you may need to increase or decrease the timeout ...

Get Python Business Intelligence Cookbook 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.