There are many different tools for making data visualizations in Python, but some of the most common are
- Jupyter Notebooks for running code and viewing results
pandas
for loading and organizing datamatplotlib
andseaborn
for making data visualizations
We’ll be using all of these in this course, so let’s take some time to go over each one.
Jupyter Notebook
A Jupyter Notebook is a web-based environment for writing code and displaying results. We’ve loaded an example notebook to the right. Each Jupyter Notebook consists of a sequence of cells. There is one cell for this exercise, corresponding to the Checkpoint 1 exercise below.
pandas
Most data scientists who work in Python also use pandas
, which is a library specifically designed for data analysis. Conventionally, pandas
is shortened to pd
when it’s imported.
matplotlib
and seaborn
matplotlib
and seaborn
are Python libraries that are specifically designed to make data visualizations. To make data viz with matplotlib
, we import just one module (called pyplot
) from the library, and shorten it to plt
. seaborn
is conventionally imported as sns
.
In this exercise, we’ll learn how to run and test some pandas
code in the Jupyter notebook on the right. In the next exercise, we’ll see how matplotlib
comes into play!
Instructions
We’ll dig into the details of importing a dataset in the next exercise. For now, let’s practice running code in a Jupyter Notebook.
- Select the code cell beginning
import pandas
(click anywhere in the cell) - Click the
Run
button or theShift
+Enter/Return
keys (see image below) - Click the
Save
button or use theControl/Command
+S
keys to save your work - Click the
Test Work
button below the Jupyter Notebook to check if you’ve completed the Checkpoint!
If you’ve successfully completed the Checkpoint, you’ll get a green check at the top of the checkpoint. When all checkpoints are complete, the Next
button at the bottom right will become clickable.