WeCodeAcademy

Frequency Tables and Histograms

To see how data is distributed, count it. A frequency table counts each category (value_counts). For numbers, group them into bins first (pd.cut or np.histogram); the counts per bin make a histogram.

Examplepython
Open in editor »
Quick check

In a histogram, what does the height of a bar show?

Your turn: write the code

Count how many ages fall in each bin [0,18), [18,40), [40,100) and print the counts.

Finish the quick check (and any code exercise) to complete this lesson, or mark it done yourself.

Tip: use the left and right arrow keys to move between lessons.