Data Distribution
A distribution describes how values are spread and how often they occur. Inspect it before choosing a model or a summary.
Understand the idea
Counts by value provide a simple discrete distribution. Continuous measurements usually need intervals, plots, and checks for missingness or unusual groups. Data collection can distort the observed distribution, so an appealing histogram does not prove the sample represents the intended population. Check the sampling process as well as the values.
Where to try it
Open this example with Try in playground. The code loads as editable text and does not run until you select Run. The first run downloads Python. Each run starts fresh; temporary files created by a script are not files on your PC.
A worked example
from collections import Counter
seats = [1, 2, 2, 3, 1, 2]
for value, count in sorted(Counter(seats).items()):
print(value, count)
Read the result
One seat occurs twice, two seats three times, and three seats once.
Try one change
Compute relative frequencies and confirm that their sum is one.
For package options, see the scikit-learn documentation.