Data Projects Basics: Ask a Question, Query and Chart
Charts and a First Finding
In this lesson you will
- Make a labelled bar chart from a pandas result
- Write a short finding that states evidence and limits
- Organise a project folder with a README
Introduction
An analysis is not finished until someone understands it. A clear chart and a short, honest finding turn your work into something others can use.
A chart of loans by genre
Using the counts from the last lesson:
Python
import matplotlib.pyplot as plt
counts = df["genre"].value_counts()
ax = counts.plot(kind="bar", title="Library loans by genre, Jan to Mar 2024")
ax.set_xlabel("Genre")
ax.set_ylabel("Number of loans")
plt.tight_layout()
plt.savefig("loans_by_genre.png")This draws one bar per genre: Crime (11), Fiction (8), Food (6) and Home (5). Install matplotlib with pip install matplotlib. A good chart has:
- A title stating what it shows and the period
- Labelled axes with units
- Bars that start at zero
- Few colours, and no decoration
Quick quiz
Why should the bars in a bar chart start at zero?
Write the finding
A finding has four parts: what you found, the evidence, the limits, and what to do next.
Finding: Crime books were the most borrowed in January to March 2024, with 11 of 30 loans (37 percent). Cold Case was the single most borrowed title, with 6 loans. Loans rose each month, from 7 in January to 10 in February and 13 in March.
Limits: This is a small practice dataset of 30 loans and six members, so the pattern may be chance. Leeds members also borrowed more partly because there are more of them.
Next: Check loans per member, and repeat the analysis with a longer period.
Check the numbers: 11 รท 30 is 36.7 percent, rounded to 37. Monthly loans 7 + 10 + 13 = 30.
Rules for good findings:
- Lead with the answer to the question you set.
- Give numbers, not just adjectives.
- State limits honestly. This builds trust.
- Avoid claiming causes you cannot show.
- Keep it short. A reader should get it in half a minute.
Organise the project
A tidy folder helps you and others:
library-project/
README.md what the project is, how to run it
data/ raw data (never edit by hand)
src/ scripts or notebooks
output/ charts and tables you produceIn the README, write the question, where the data came from, how to run the code, the main finding and its limits. Keep raw data untouched, and make your code create everything else.
Respect the data
Even practice habits matter. Real library data would be about people. Use only what you need, remove names when they are not needed, store it securely and follow the rules where you work or study.
Where to go next
In Data Projects Intermediate, you will clean messier data, join tables more carefully, use SQL window functions and build an analysis notebook that tells a story.
Try it yourself
Make the chart, write your own four-part finding about loan length by genre (with the counts), and create a README for the project.
Summary
- A good chart has a clear title, labelled axes and zero-based bars.
- A finding states the answer, the evidence, the limits and the next step.
- Keep raw data untouched, organise folders and write a README so others can follow your work.
Lesson complete
+20 XP
Nice work. Keep going while it is fresh.
Sources and further reading