Dumbbell charts
📖 Scenario: You are a data analyst at a fitness center. You want to compare the average weights lifted by two groups of people: beginners and advanced trainees. A dumbbell chart is a great way to show the difference between these two groups for each exercise.
🎯 Goal: Build a dumbbell chart using matplotlib to visually compare the average weights lifted by beginners and advanced trainees for different exercises.
📋 What You'll Learn
Create a dictionary with exercises as keys and tuples of (beginner weight, advanced weight) as values.
Create a list of exercises from the dictionary keys.
Extract beginner and advanced weights into separate lists.
Plot a dumbbell chart using
matplotlib with lines connecting beginner and advanced weights for each exercise.Label the axes and add a title.
💡 Why This Matters
🌍 Real World
Dumbbell charts are useful to compare two related values side-by-side for multiple categories, such as comparing performance before and after training.
💼 Career
Data analysts and scientists often create such charts to communicate differences clearly in reports and presentations.
Progress0 / 4 steps