Locked lesson.

## About this lesson

In this video, we discuss density plots, kernel density estimation (KDE) plots, and how to create them.

## Exercise files

Download this lesson’s related exercise files.

Plotting Density Plots.docx57.2 KB Plotting Density Plots - Solution.docx

55.4 KB

## Quick reference

### Plotting Density Plots

Kernel Density Plots, and Density plots, are basically the same thing and allow you to estimate the probability density function of a random variable.

### When to use

Use the methods whenever you want to chart the kernel density of your data.

### Instructions

The first method of creating a kernel density plot is:

my_df.plot(kind='kde')

The second method of creating a kernal density plot is:

my_df.plot.kde()

You need scipy to run a kde plot. From inside the terminal, run:

pip install scipy

### Hints & tips

- my_df.plot(kind='kde')
- my_df.plot.kde()
- pip install scipy

Lesson notes are only available for subscribers.