Locked learning resources

Join us and get access to thousands of tutorials and a community of expert Pythonistas.

Unlock This Lesson

Locked learning resources

This lesson is for members only. Join us and get access to thousands of tutorials and a community of expert Pythonistas.

Unlock This Lesson

Exporting to Jupyter

Resource mentioned in this lesson: Jupyter Notebook: An Introduction

00:00 In the previous lessons, we created and looked at a profile report in an HTML format. But you could also view a profile report directly inside a Jupyter notebook.

00:11 In order to view a profile report directly in a Jupyter notebook, you can use the .to_notebook_iframe() method. There are some other prerequisites, such as having the ipywidgets package installed in your Python environment. So if you’re using uv, that would be uv add ipywidgets.

00:28 And if you’re using VS Code to view your Jupyter notebooks, you will also need the ipykernel package installed in your environment so that VS Code connects correctly to the virtual environment created by uv.

00:41 Once these are in place, the code is almost the same as creating a profile report as HTML.

00:47 So here we have a Jupyter notebook where the first cell contains all the code we had before. So it starts with importing the necessary packages.

00:56 Then we read the data into a pandas DataFrame and create a profile report object.

01:03 Now when that’s complete, instead of saving it to a file, we use the .to_notebook_iframe() method. And when you run that, you will see the same messages, the same loading bar as you did when we ran this on the terminal.

01:20 So we’ll just wait for it to explore and summarize the dataset, generate the necessary charts, which we will then see directly in the Jupyter notebook. Just like before, that takes about a minute to run.

01:33 And this time we don’t have to jump to the web browser to view the output. We can see it directly inside the Jupyter notebook, in this case directly inside VS Code.

01:43 And it’s exactly the same profile report, all in one place.

01:48 If you’re interested in learning more, check out this course all about Jupyter notebooks.

01:54 In the next lesson, we will talk about how we can use this package to analyze time series data.

Become a Member to join the conversation.