Tristen.

Presenting Data Using Jupyter Notebook Slides (VS Code)

January 13, 2024 (11mo ago)

Presenting Data Using Jupyter Notebook Slides (VS Code)

When considering tools for creating slide presentations, the usual suspects often come to mind: Microsoft PowerPoint and Google Slides. Both are excellent choices, offering a wide array of formatting options and seamless integration with other Microsoft and Google software. However, there’s another powerful tool for crafting presentations, particularly for those who frequently work with code: Jupyter Notebook Slides.

One of the standout features of Jupyter Notebook Slides is the ability to transform your coding workspace directly into a presentation. This feature is particularly beneficial for technical presentations, as it allows you to showcase your data modeling and visualization work within the same tool you used to create it.

The process is straightforward, especially for those familiar with Markdown. You can easily select specific cells from your notebook to feature in your presentation and choose which ones to omit. Concerns about formatting are minimal, given the intuitive nature of Markdown in Jupyter Notebooks.

In the following sections of this blog, I’ll guide you through a concise tutorial on converting a Jupyter notebook into an engaging and informative slideshow using VS Code and the terminal.

Walkthrough

Start with a Jupyter Notebook:

Open Jupyter Notebook in VS Code.

Jupyter Notebook in VS Code

To set your code blocks as slides, right-click the bottom of the code block and select “Switch Slide Type.”

Switch Slide Type

Switch Slide Type

Next, we can select what type of slide each cell should be. These are the options:

  • Slide: Adds a main slide to the presentation
  • Subslide: Sits below the previous slide and must be clicked on to view
  • Fragment: Adds a fragment to the previous slide
  • Skip, Notes: Does not create a slide from the cell

Select Slide Type

Select Slide Type

Once we have set all of the slides, we can export the slides as an HTML file using the terminal:

jupyter nbconvert notebook_name.ipynb --to slides --post serve --no-input --no-prompt

Example Presentation

Example Presentation

Conclusion

Jupyter Notebook slides provide a straightforward and uncluttered layout, making them remarkably easy to generate. Although they may not boast the extensive formatting and design capabilities of more traditional presentation software, they excel in presenting code and data visualizations, making them an ideal choice for technical presentations.