Basic histogram with plt.hist
📖 Scenario: You have collected the ages of a group of people at a community event. You want to see how these ages are spread out to understand the age distribution.
🎯 Goal: Build a simple histogram using plt.hist to visualize the distribution of ages.
📋 What You'll Learn
Create a list called
ages with the exact values: 22, 25, 29, 22, 24, 30, 27, 25, 29, 31Create a variable called
bins and set it to 5Use
plt.hist with ages and bins to create the histogramUse
plt.show() to display the histogram💡 Why This Matters
🌍 Real World
Histograms help us understand how data like ages, heights, or test scores are spread out in a group.
💼 Career
Data scientists use histograms to quickly see patterns and distributions in data, which helps in making decisions or building models.
Progress0 / 4 steps