Build a Data Story with Key Events
Advanced · Write the code · from Data Visualization: Choose the Right Chart and Tell a Story
From the lesson: Data Visualization: Choose the Right Chart and Tell a Story
A chart that looks pretty but tells the wrong story is worse than no chart at all. In 1986, NASA engineers showed managers a chart arguing that cold temperatures could damage the Space Shuttle Challenger's O-ring seals. The chart was so poorly designed that the managers couldn't see the pattern.
Read the lessonWrite a function build_narrative(data, events) where data is a dict of {month: value} and events is a dict of {month: event_description}. The function should return a list of strings, one per event, in the format 'MONTH: VALUE - EVENT'. Only include months that appear in both dicts. Print each narrative line for the test data.
More Data Visualization exercises
All Python exercises · 50 practice problems · Data Science & Machine Learning quiz