Final project: from messy data to a conclusion
Clean a real-looking dataset, analyze it, chart it, and state what you found.
Now you will put every step together, the way a real analysis goes. A city’s libraries logged weekly visits, but the data is messy: inconsistent branch names, a few missing counts, and a duplicated row. The plan is: (1) clean, (2) analyze with groupby, (3) chart the result, and (4) write a one-sentence conclusion that a non-programmer could understand, including any caveats about how you cleaned the data. Each exercise below is one step and starts from the raw data, so you can do them in order.
# The four steps of almost every analysis:
# 1. Clean: fix names and types, handle missing values, drop duplicates
# 2. Analyze: filter, groupby, sort, compute percents
# 3. Chart: choose the chart that fits the question, label it honestly
# 4. Conclude: one clear sentence, plus any caveats
print("Question: Which library branch is busiest, and by how much?")Writing the question first keeps each step focused on answering it.
A good conclusion states the finding, the numbers behind it, and its limits: "Over 4 weeks, Elm had the most visits (about 1,600, just over half the total). Two missing counts were left out."