# The Python You Need for Data

Brush up on the Python that data work leans on: functions, lists, dictionaries, rows of data as a list of dictionaries, and reading a CSV file. Then answer a coffee chain's question by hand, and see exactly where hand-written code starts to struggle, which is the problem pandas solves next.

Updated: November 19, 2026

## [Functions, a Refresher](https://www.ask-codey.com/courses/python-data-analysis/topics/data-refresher-functions)

1. [Parameters and Return Values](https://www.ask-codey.com/lessons/python-functions-parameters-and-return) (Novice): Parameters let a function work on whatever values each call hands it, and return hands a result back to the code that called it, which is different from printing it and gives None when a function returns nothing.

## [Lists and Dictionaries, a Refresher](https://www.ask-codey.com/courses/python-data-analysis/topics/data-refresher-lists-and-dictionaries)

1. [Lists: Keeping Things in Order](https://www.ask-codey.com/lessons/python-lists) (Novice): A list keeps many values in order under one name, so you can read any item by its index, counting from 0 at the front or from -1 at the back, add, insert and remove items, and check whether a value is there with in.
2. [Dictionaries: Looking Things Up by Name](https://www.ask-codey.com/lessons/python-dictionaries) (Novice): A dictionary stores each value under a key you choose, so a program finds a value by its name instead of its position, and adds, changes and removes entries as the data changes.
3. [Looping Through Dictionaries and Nested Data](https://www.ask-codey.com/lessons/python-dictionaries-nested-data) (Apprentice): A for loop goes through a dictionary's keys, items(), keys() and values() give its pairs, its keys or its values, and lists of dictionaries and dictionaries of lists hold whole tables of data, the shape CSV files and web APIs give you.

## [CSV Files, a Refresher](https://www.ask-codey.com/courses/python-data-analysis/topics/data-refresher-csv)

1. [CSV Files: Tables in Plain Text](https://www.ask-codey.com/lessons/python-files-csv) (Apprentice): A CSV file is a table in plain text that every spreadsheet can open and save, and Python's csv module writes it with DictWriter and reads it with reader or DictReader, giving back every value as text that you convert to numbers with int() and float().

## [Why pandas](https://www.ask-codey.com/courses/python-data-analysis/topics/data-why-pandas)

1. [Answering a Question by Hand, and Where It Breaks](https://www.ask-codey.com/lessons/data-by-hand-where-it-breaks) (Apprentice): A list of order dictionaries, a loop and a dictionary of running totals answer a coffee chain's question about sales by store in plain Python, and three more questions and one blank price show where hand-written code starts to strain, which is the problem a table library such as pandas solves.

## [Exercise: Coffee Orders by Hand](https://www.ask-codey.com/courses/python-data-analysis/topics/exercise-data-coffee-orders-by-hand)

1. [Exercise: Coffee Orders by Hand](https://www.ask-codey.com/lessons/exercise-data-coffee-orders-by-hand) (Apprentice): Read a week of Bean Street Coffee's orders with the csv module and answer the owner's questions in plain Python, total sales by store, the best-selling drink and the average order, with four functions that pytest checks.

Source: https://www.ask-codey.com/courses/python-data-analysis/chapters/data-python-you-need
