Making a histogram

Introduzione alla Data Science in Python

Hillary Green-Lerman

Lead Data Scientist, Looker

Tracking down the kidnapper

Introduzione alla Data Science in Python

What is a histogram?

Introduzione alla Data Science in Python

Histograms with matplotlib

plt.hist(gravel.mass)

plt.show()

Introduzione alla Data Science in Python

Changing bins

plt.hist(data, bins=nbins)
plt.hist(gravel.mass, bins=40)

Introduzione alla Data Science in Python

Changing range

plt.hist(data,
         range=(xmin, xmax))
plt.hist(gravel.mass,
         range=(50, 100))

Introduzione alla Data Science in Python

Normalizing

Unnormalized bar plot

plt.hist(male_weight)
plt.hist(female_weight)

Sum of bar area = 1

plt.hist(male_weight, density=True)
plt.hist(female_weight, density=True)

Introduzione alla Data Science in Python

Let's practice!

Introduzione alla Data Science in Python

Preparing Video For Download...