Lectures in Scientific Computing in Python
This repository contains all lectures from the course Scientific programming in Python that is part of the Cognitive Science program at the University Osnabrück. Each lecture is accompanied by a Jupyter notebook that explains each topic with a combination of code and text. You can view the notebooks directly on GitHub or run them locally and play with the code. If you do not want to install anything, click on the Binder logo above to run all the notebooks in a ready to use environment in the cloud.
All lecture recordings from 2018 can be viewed on Youtube and on the Opencast platform.
Create a virtual Python environment, name e.g. scientific, for example using
$ conda env create -f environment.yml
Activate the environment
$ conda activate scientific
you might see some error like
your shell has not been set up to use conda activate. Follow the instructions given in your shell to make it work.
then start JupyterLab
$ jupyter lab
JupyterLab should open in your browser. From there you can navigate to the notebooks and interact with them.
Before committing changes, run the whole notebook from top to bottom using (for
$ env RUNALL=1 jupyter nbconvert --execute --allow-errors --inplace lecture.ipynb
$ export RUNALL=1 jupyter nbconvert --execute --allow-errors --inplace lecture.ipynb
To make new interactive exercises install jupyter-solutions and set up as teacher, by setting
c.JupyterLabRmotrSolutions.role = "teacher"
in the repositories
Only use markdown headers to structure the lectures. Numbering will be automatically handled by the jupyterlab-toc extension. Also use markdown to talk about the content of the lecture and the next cells. Use comments only if you want to highlight something in a specific line of code. If you write comments, write them in full sentences.
nbdime to make working with notebooks and git easier
pip install nbdime nbdime config-git --enable
Thanks to Auss Abbood for making the videos YouTube ready!