Examples
From a given a Series of points randomly sampled from an unknown distribution,
estimate its PDF (probability density function) using KDE (Kernel Density Estimate) with
automatic bandwidth determination and plot the results, evaluating them at 1000 equally
spaced points (default):

In [1]:
import numpy as np
import pandas as pd
In [3]:
s = pd.Series([2, 3, 3.5, 4, 4.5, 4, 6])
ax = s.plot.kde()

A scalar bandwidth can be specified. Using a small bandwidth value can lead to over-fitting,
while using a large bandwidth value may result in under-fitting:

In [4]:
ax = s.plot.kde(bw_method=0.3)
In [5]:
ax = s.plot.kde(bw_method=3)

The ind parameter determines the evaluation points for the plot of
the estimated PDF(probability density function):

In [6]:
ax = s.plot.kde(ind=[2, 3, 4, 5, 6])

For DataFrame, it works in the same way:

In [7]:
df = pd.DataFrame({
     'p': [2, 3, 3.5, 4, 4.5, 5, 6],
     'q': [5, 5, 5.5, 6, 6.5, 7, 7],
})
ax = df.plot.kde()

A scalar bandwidth can be specified. Using a small bandwidth value can lead to over-fitting,
while using a large bandwidth value may result in under-fitting:

In [8]:
ax = df.plot.kde(bw_method=0.3)
In [9]:
ax = df.plot.kde(bw_method=3)

Finally, the ind parameter determines the evaluation points for the plot of the estimated PDF:

In [10]:
ax = df.plot.kde(ind=[2, 3, 4, 5, 6, 7])