Reader small image

You're reading from  Python Real-World Projects

Product typeBook
Published inSep 2023
PublisherPackt
ISBN-139781803246765
Edition1st Edition
Right arrow
Author (1)
Steven F. Lott
Steven F. Lott
author image
Steven F. Lott

Steven Lott has been programming since computers were large, expensive, and rare. Working for decades in high tech has given him exposure to a lot of ideas and techniques, some bad, but most are helpful to others. Since the 1990s, Steven has been engaged with Python, crafting an array of indispensable tools and applications. His profound expertise has led him to contribute significantly to Packt Publishing, penning notable titles like "Mastering Object-Oriented," "The Modern Python Cookbook," and "Functional Python Programming." A self-proclaimed technomad, Steven's unconventional lifestyle sees him residing on a boat, often anchored along the vibrant east coast of the US. He tries to live by the words “Don't come home until you have a story.”
Read more about Steven F. Lott

Right arrow

Chapter 14
Project 4.2: Creating Reports

One easy way to share good-looking results is to use a Jupyter notebook’s Markdown cells to create a presentation. This chapter will create a “slide deck” that can be shared and presented. We can expand on this to create a PDF report using additional packages like Jupyter book or Quarto.

In this chapter, we’ll look at two important working results of data analysis:

  • Slide decks build directly from a Jupyter Lab notebook.

  • PDF reports built from notebook data and analysis.

This chapter’s project will upgrade an analysis notebook created in the previous chapter to create presentations that can be shared with colleagues. We’ll start by looking at the kinds of reports an analyst may need to produce.

14.1 Description

The first dozen chapters in the book created a pipeline to acquire and clean raw data. Once the data is available, we can now do more analytical work on the clean data.

The goal is to transform raw data into information, and possibly even insight to help stakeholders make properly informed decisions. Analytical results need to be shared to be valuable. A Jupyter Notebook is a solid basis to create readable, helpful presentations and reports.

We’ll start by transforming an analysis notebook into a slide deck. You can then use this slide deck to talk through our key points with stakeholders, providing helpful visuals to back up the information they need to understand. These are common in an enterprise environment. (Some would argue they are too common and contain too much of the wrong kind of details.)

We’ll start by looking at creating slide decks and presentations in Jupyter Lab.

14.1.1 Slide decks and presentations

A Jupyter Notebook can be exported...

14.2 Overall approach

We’ll talk about the general technical steps to creating presentations and reports in a Jupyter Notebook. For presentations, no additional tools are needed. For some simple reports, the File menu offers the ability to save and export a notebook as pure Markdown, as a PDF file, or as a LaTeX document. For more complicated reports, it can help to use supplemental tools that create a more polished final document.

14.2.1 Preparing slides

An HTML-based presentation via Reveal.js is a first-class feature of a Jupyter Notebook. The File menu offers the ability to save and export a notebook as Reveal.js slides. This will create an HTML file that will display as a presentation.

Within Jupyter, the property inspector is used to set the type of slide for a cell. There’s an icon of two meshed gears on the top right side of the page to show the property inspector in the right sidebar. Under the View menu, the option to show the right sidebar will also show...

14.3 Deliverables

There are two deliverables for this project:

  • A presentation

  • A report

The presentation should be an HTML document using the Reveal.js slide deck.

The report should be a PDF document from a single notebook. It should contain the visualization figures and some narrative text explaining the images.

For information on unit testing and acceptance testing of the notebooks, see Chapter 13, Project 4.1: Visual Analysis Techniques. This project should build on the previous project. It doesn’t involve dramatic new programming. Instead, it involves the integration of a large number of components to create meaningful, useful presentations and reports.

14.4 Summary

In this chapter, we have built two important working results of data analysis:

  • Slide decks that can be used as presentations to interested users and stakeholders

  • Reports in PDF format that can be distributed to stakeholders

The line between these two is always hazy. Some presentations have a lot of details and are essentially reports presented in small pages.

Some reports are filled with figures and bullet points; they often seem to be presentations written in portrait mode.

Generally, presentations don’t have the depth of detail reports do. Often, reports are designed for long-term retention and provide background, as well as a bibliography to help readers fill in missing knowledge. Both are first-class parts of a Jupyter notebook and creating these should be part of every analyst’s skills.

This chapter has emphasized the additional tools required to create outstanding results. In the next chapter, we’ll shift gears and look at some of the statistical...

14.5 Extras

Here are some ideas for the reader to add to these projects.

14.5.1 Written reports with UML diagrams

In Creating technical diagrams the process of creating UML diagrams was summarized. The reader is encouraged to use PlantUML to create C4 diagrams for their data acquisition and cleaning pipeline. These .jpg files can then be incorporated into a report as Markdown figures.

For more information on the C4 model, see https://c4model.com.

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Python Real-World Projects
Published in: Sep 2023Publisher: PacktISBN-13: 9781803246765
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

Author (1)

author image
Steven F. Lott

Steven Lott has been programming since computers were large, expensive, and rare. Working for decades in high tech has given him exposure to a lot of ideas and techniques, some bad, but most are helpful to others. Since the 1990s, Steven has been engaged with Python, crafting an array of indispensable tools and applications. His profound expertise has led him to contribute significantly to Packt Publishing, penning notable titles like "Mastering Object-Oriented," "The Modern Python Cookbook," and "Functional Python Programming." A self-proclaimed technomad, Steven's unconventional lifestyle sees him residing on a boat, often anchored along the vibrant east coast of the US. He tries to live by the words “Don't come home until you have a story.”
Read more about Steven F. Lott