pandas.Series.plot.hist

pandas 3.1.1 · Series and accessors · method

Draw histograms to show how numeric observations are distributed across bins.

Call syntax

Series.plot.hist(by=None, bins=10, **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

ParameterRequirementAccepted values and behavior
by Optional
Positional or keyword
Default None
str or sequence

Specify the labels, mapping, or values that determine the sort or grouping.

bins Optional
Positional or keyword
Default 10
int

Set a number of bins or provide bin boundaries.

**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.hist())