Computer scienceData scienceInstrumentsVisualizationMatplotlib overview

Numeric data visualization

Histogram

Report a typo

You have the cat.csv dataset on your computer. It contains the data on your cat's activities every day of the month: how long it slept, how many times it had lunch, how long it spent outside, and so on. You want to plot the sleep column on a histogram. How do you do that? Drag steps in the right order.

Note: we recommend putting import statements in alphabetic order.

Put the items in the correct order
sleep = data['sleep']
import matplotlib.pyplot as plt
plt.hist(sleep)
import pandas as pd
plt.title('Sleep duration')
data = pd.read_csv('cat.csv')
___

Create a free account to access the full topic