pandas.Series.plot.density
pandas 3.1.1 · Series and accessors · method
Plot a smooth estimate of the density of numeric values.
Call syntax
Series.plot.density(bw_method=None, ind=None, weights=None, **kwargs)Inspect the call
Run this code to inspect the callable and its parameters. Its data, backend, or environment is needed to execute the operation itself.
Parameters
| Parameter | Requirement | Accepted values and behavior |
|---|---|---|
bw_method |
Optional Positional or keyword Default None |
str, scalar or callable Choose a bandwidth for kernel density estimation. |
ind |
Optional Positional or keyword Default None |
NumPy array or int |
weights |
Optional Positional or keyword Default None |
NumPy array Supply values representing relative importance for sampling or calculation. |
**kwargs |
Optional Additional keyword arguments |
Returns
matplotlib.axes.Axes or numpy.ndarray of them
Example for a local Python session
import pandas as pd
import matplotlib
values = pd.Series([2., 5., 7.], name="units")
print(values.plot.density())