Data Analysis Best Practices
Best practices for answering questions with data in SQL, pandas and Polars, checked against Google's Good Data Analysis guide and the pandas, Polars and PostgreSQL documentation. It covers framing the question, reading data correctly, joins and grain, aggregation pitfalls, reproducible notebooks, checking results and communicating findings.
7
Sefism · Oct 2026
28
Sefism · Oct 2026
8
Sefism · Oct 2026
Data and ML
Sefism · Oct 2026
Best practices
Other
Sefism
17 min read
Intermediate
Free
What this best practices guide is
Best practices for answering questions with data in SQL, pandas and Polars, checked against Google's Good Data Analysis guide and the pandas, Polars and PostgreSQL documentation. It covers framing the question, reading data correctly, joins and grain, aggregation pitfalls, reproducible notebooks, checking results and communicating findings.
It has 7 chapters and 28 practices, each with why it matters, what to do and what to avoid. For analysts and engineers who answer questions with data.
Chapter by chapter
1. Frame the question first (4 practices)
An analysis is only as useful as the question behind it. These practices pin down what you are measuring and why before you write a query.
2. Read the data correctly (4 practices)
Summary numbers hide most problems. These practices get you looking at what a row means, how values are distributed and how your tools read types.
3. Joins without surprises (4 practices)
A join that changes the number of rows you expected is the most common silent error in analysis. These practices check cardinality, unmatched rows and nulls every time.
4. Aggregation pitfalls (4 practices)
Aggregates compress thousands of rows into one number, and the compression hides mistakes. These practices cover nulls, ratios, additivity and slicing.
5. Reproducible notebooks and code (4 practices)
If you cannot rerun an analysis next month and get the same numbers, you cannot defend it. These practices make notebooks and queries repeatable.
6. Check your results before trusting them (4 practices)
Surprising results are usually bugs. These practices, mostly from Google's Good Data Analysis guide, help you tell a finding from a mistake.
7. Communicate findings (4 practices)
An analysis only helps if people understand it and trust it. These practices make the answer, its limits and its evidence clear.
How it works on Sefism
The guide reads like a short course: a syllabus, then one chapter per page in a focused reader, with a quiz at the end of each chapter for members. The opening chapters are open to everyone. Adding it to your account uses credits, opens every chapter and keeps your progress.
Every claim is checked against the sources listed on the page (8 cited).
Ready to start?
Opens on Sefism in a new tab.
Stuck on something specific?
Writing only gets you so far. If you want an answer to your situation rather than the general case, book a session and we will work through it together. Sessions are free for approved Sefism members, and a few slots open each week.
Follow along
New writing, resources and project ideas land here first.