Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python for Data Analysis (Koans)

Koan-style unit tests to practice the core topics from Wes McKinney’s Python for Data Analysis (3rd ed.).

Book (open edition): Python for Data Analysis, 3E

What this is

This repo is a practice workbook for the book:

  • You learn by fixing tests: pytest starts red; you implement small functions in koans/ until it turns green.

  • Chapter-aligned: each tests/test_XX_*.py file maps to a book theme; see docs/overview.md.

  • Docs: see docs/

  • Koans (tests you complete by editing code): see tests/

Quickstart

Create a virtualenv and install dependencies:

python3 -m venv .venv
. .venv/bin/activate
python -m ensurepip --upgrade
python -m pip install -U pip
pip install -e ".[dev]"

Run the koans:

pytest -q

Optional chapters (extras)

Some later-chapter koans are optional and will be skipped unless you install extras:

pip install -e ".[io]"       # parquet (pyarrow)
pip install -e ".[viz]"      # plotting (matplotlib)
pip install -e ".[modeling]" # modeling (scikit-learn)

Do one chapter at a time

KOAN=01 pytest -q   # python basics
KOAN=07 pytest -q   # time series

How koans work here

  • Tests start out failing with clear messages.
  • You fix them by editing functions in koans/.
  • Re-run pytest and iterate.

About

Koans for Python for Data Analysis, 3E

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages