🚀 New batches open: Advanced Excel • Power BI • SQL • AI for Analytics — Book a free demo

Day 11 — Python for data analysis basics

Everything so far, applied to a realistic dataset. This is what the first month of an analyst job looks like.

Our dataset

A list of rows, each a tuple. Run this to see it.

The headline numbers

Grouping — the most useful pattern there is

This is the Python equivalent of a PivotTable or a SQL GROUP BY. Learn this shape by heart.

The same thing, shorter, with .get():

Sorting the result

Sorting a list of (amount, name) tuples sorts by amount first — a neat trick for ranking a dictionary.

A complete little report

What comes next Everything above is plain Python. In real work you would do it with pandas in about three lines. Pandas needs a real Python installation, which is where our course picks up — but understanding the loop underneath is what stops pandas being magic you cannot debug.

Try these yourself

  1. Total the amounts per city instead of per person.
  2. Find the single largest order and print who made it.
  3. Count how many orders each rep made (not the total value).
  4. Print only reps whose total is above 60000.

Ready for pandas and real projects?

This tutorial covers core Python. Our Data Analytics course takes you into pandas, NumPy, real files and visualisation, with mentor support and portfolio projects.

See the course →