Curriculum
Course: Pandas
Login
Text lesson

Histogram

To create a histogram, specify the kind argument as 'hist'.

A histogram requires just one column and displays the frequency of data within specified intervals, such as how many workouts lasted between 50 and 60 minutes.

In the example below, we’ll use the “Duration” column to generate the histogram.

Example

df[“Duration”].plot(kind = ‘hist’)

Result

img_pandas_plot_hist

Note: The histogram indicates that more than 100 workouts lasted between 50 and 60 minutes.