Normalized histograms
📖 Scenario: You are analyzing the heights of a group of people. You want to see how the heights are spread out using a histogram. But instead of just counting how many people fall into each height range, you want to see the relative frequency so you can compare it easily with other groups.
🎯 Goal: Create a normalized histogram of the heights data using matplotlib. This means the histogram bars will show proportions instead of counts.
📋 What You'll Learn
Create a list called
heights with exact valuesCreate a variable called
bins to set the number of binsUse matplotlib's
hist() function with density=True to create a normalized histogramDisplay the histogram with
plt.show()💡 Why This Matters
🌍 Real World
Normalized histograms help compare data distributions fairly, especially when sample sizes differ. For example, comparing heights of people from different cities.
💼 Career
Data scientists use normalized histograms to visualize and compare data distributions clearly, which helps in making data-driven decisions.
Progress0 / 4 steps