A short, hands-on course that teaches Python by using it to do real chemistry: analysing lab data, plotting results, and exploring reactions. Every lesson is a Jupyter notebook you can run in your browser without installing anything.
New here? Go straight to Run it in your browser. You will be running real chemistry code in a minute or two.
- Run it in your browser
- What you will learn
- The lessons
- Datasets
- Run it on your own machine
- A note for Google Colab users
The easiest way to start is Binder. Click the button below. Binder reads this course's requirements.txt, installs everything for you, and opens Jupyter in your browser. Nothing to download.
The first launch takes a minute or two while Binder sets up the environment. After that, open a lesson from the file list on the left and run each cell with Shift and Enter.
Prefer to open one specific lesson directly? Use the per-lesson buttons in The lessons below. Each lesson has a Binder button (everything preinstalled) and a Colab button (fast to open, see the Colab note).
- Reading and cleaning real lab data with pandas
- Doing calculations with numpy
- Turning numbers into clear plots with matplotlib
- Working with reactions and chemical quantities using chempy
- Building the habit of exploring data in a notebook, one cell at a time
No prior Python is assumed. Basic chemistry (concentrations, reactions, titrations) is helpful but each idea is explained as it comes up.
Work through them in order. Each button opens that lesson ready to run.
There are also slides, Python_for_Applied_Chemistry.pptx, that introduce the course.
The lessons use small, real CSV datasets kept in the datasets/ folder:
nwsc_water_quality.csv- water quality measurementsreaction_kinetics.csv- reaction rate data over timetitration_data.csv- titration readings
When you launch with Binder or Codespaces these come along automatically. In Colab they load straight from this repository.
If you would rather not use the browser:
- Clone the repository:
git clone https://github.com/Kubomu/chemistry-python-course.git cd chemistry-python-course - Install the packages:
pip install -r requirements.txt
- Start Jupyter and open a lesson:
jupyter lab
You can also open the folder in GitHub Codespaces (Code button, then Codespaces) and the environment installs itself.
Colab opens instantly and already has pandas, numpy, and matplotlib, so Lessons 1 and 2 run as is. Lesson 3 uses chempy, which Colab does not include by default. When you open Lesson 3 in Colab, add a new cell at the very top and run this once:
!pip install chempyThen run the rest of the notebook normally. Binder does not need this step because it installs everything from requirements.txt for you.