Author: Richard Foltyn, University of Glasgow
NOTE: This repository is no longer being maintained. Please use the material hosted here instead which was prepared for a more recent, similar course.
This introductory course consists of several units. Each unit corresponds to one interactive Jupyter notebook, which is also available as a static PDF file. Alternatively, you can download the entire course as a single PDF.
- Crash course for the impatient [PDF]
- Language and NumPy basics [PDF]
- Control flow and list comprehensions [PDF]
- Reusing code - Functions, modules and packages [PDF]
- Plotting [PDF]
- Advanced NumPy [PDF]
- Random number generation and statistics [PDF]
- Handling data with pandas [PDF]
- Data input and output [PDF]
- Error handling [PDF]
- Applications: Econometrics [PDF]
The launch binder link at the top to start an interactive notebook.
Click on the button above to use the notebooks directly in your web browser (in might take a while to set up the environment). No local Python installation is required.
If you are familiar with git, clone the repository:
git clone https://github.com/richardfoltyn/python-statistics.git
Otherwise, download the contents as a ZIP file by clicking on above.
On Windows, you need to install a local Python environment such as Anaconda. On Linux, your distribution comes with Python but the required packages are most likely outdated, so it is still recommended installing Anaconda.
Once Anaconda is installed, click on Jupyter Notebook in the Start menu
and navigate to where you extracted the repository contents. Select
index.ipynb
to run the main notebook.
You need to create a new Python environment which contains all the required packages. You can use the specification provided in environment.yml to accomplish that:
conda env create -f environment.yml
Activate the virtual environment you just created:
conda activate python-statistics
To start the Jupyter notebook server, navigate to where you extracted the repository contents and run
cd path/to/repository
jupyter notebook index.ipynb
This material is licensed under a
Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License,
except for the data files contained in the data/
folder, which
fall under the terms imposed by the original content creators.
Special thanks go to Jonna Olsson for reading through all units and suggesting various improvements.