Please note, this is a STATIC archive of website www.w3resource.com from 19 Jul 2022, cach3.com does not collect or store any user information, there is no "phishing" involved.
w3resource

Pandas DataFrame: plot.hist() function

DataFrame.plot.hist() function

The plot.hist() function is used to draw one histogram of the DataFrame’s columns.

A histogram is a representation of the distribution of data. This function groups the values of all given Series in the DataFrame into bins and draws all bins in one matplotlib.axes.Axes. This is useful when the DataFrame’s Series are in a similar scale.

Syntax:

DataFrame.plot.hist(self, by=None, bins=10, **kwargs)

Parameters:

Name Description Type/Default Value Required / Optional
by                Column in the DataFrame to group by. str or sequence Optional
bins    Number of histogram bins to be used. int
Default Value: 10
Required
**kwds Additional keyword arguments are documented in DataFrame.plot().   Required

Returns: class:matplotlib.AxesSubplot
Return a histogram plot.

Example:


Download the Pandas DataFrame Notebooks from here.

Previous: DataFrame.plot.hexbin() function
Next: DataFrame.plot.kde() function