View on GitHub

notebooks

:notebook: A growing collection of Jupyter Notebooks written in Python, OCaml and Julia for science examples, algorithms, visualizations etc

Jupyter Notebooks :notebook: by Naereen @ GitHub

This repository hosts a lot of Jupyter Notebooks, covering various subjects. Everything is open-sourced under the MIT License, you can use any of these notebooks for your own teaching activities if you want. Please open an issue, or ask me anything or drop an email if you have any questions, suggestions, or more.

Which languages? Half of the notebooks here are in :gb: English, and the other half in :fr: French (surtout pour l’agrégation de mathématiques option informatique, dans ce dossier agreg/), and most use the Python language, or OCaml, and a few notebooks use other languages like Julia, Rust, Java or even Bash, C and Octave!

How to read or use these notebooks?

You can view this repository on nbviewer to read notebooks statically, or read them directly from GitHub.

You can also launch an interactive environment to play with the code by yourself, using one of these platforms:

My use of notebooks - short story since 2015

A partial list of notebooks in this repository

I’m trying to maintain here a list of the notebooks stored in this repository, inspired by the amazing pytudes by Peter Norvig. The links open nbviewer), and the links (on GitHub?) open the notebook to be viewed directly in GitHub (it should work for almost all of them).

:shell: Bash

:snake: Python

I am a passionate user of the Python programming language.

Science

Teaching

Numerical simulations for dice games (:fr: in French)

:art: Art

art/identicons.png

art/citation_du_roi_Loth_aleatoires.png

Experiments with Python

Experiments with Jupyter

With the C language

With Julia

🐫 OCaml

And more will come… soon! :bullettrain_front:

made-with-jupyter made-with-python made-with-ocaml made-with-julia


1. How to read these documents?

1.a. View the notebooks statically :memo:

1.b. Play with the notebooks dynamically :boom:

MyBinder

Anyone can use the mybinder.org website (by clicking on the icon above) to run the notebook in her/his web-browser. You can then play with it as long as you like, for instance by modifying the values or experimenting with the code.

You can also launch an interactive environment to play with the code by yourself, using one of these platforms:

Note: Only the Python kernel is supported on the MyBinder interface!


2. Requirements to run the notebooks locally?

All the requirements can be installed with pip and by running a few python -m ... commands.

Note: if you use Python 3 instead of Python 2, you might have to replace pip and python by pip3 and python3 in the next commands (if both pip and pip3 are installed).

:warning: I’ve not updated this section since 2016.

2.a. Jupyter Notebook and IPython

sudo pip install jupyter ipython

It will also install all the dependencies, afterward you should have a jupyter-notebook command (or a jupyter command, to be ran as jupyter notebook) available in your PATH:

$ whereis jupyter-notebook
jupyter-notebook: /usr/local/bin/jupyter-notebook
$ jupyter-notebook --version  # version >= 4 is recommended
4.2.1

2.b. Other kernels (optional):

They are only needed to run the notebooks written for Bash or Octave (or OCaml):

2.b.1. GNU Bash kernel

$ bash --version | head -n1
GNU bash, version 4.3.42(1)-release (x86_64-pc-linux-gnu)
sudo pip install bash_kernel
python -m bash_kernel.install

2.b.2. GNU Octave kernel

$ octave --version | head -n1
GNU Octave, version 4.0.0
$ gnuplot --version | head -n1
gnuplot 5.0 patchlevel 1
sudo pip install octave_kernel
python -m octave_kernel.install

2.b.3. OCaml kernel: OCaml-Jupyter

It is quite easy to install, with opam:

opam install jupyter

I started by using this OCaml kernel called IOCaml. The instructions were not so simple, cf. the tutorial by @andrewray on iocaml’s wiki. It was prone to some bugs, and I had to manually implement a script to be able to convert the notebooks to PDF with jupyter-nbconvert --to pdf. Note that I also had to write a custom Exporter for jupyter-nbconvert in order to convert the notebooks to OCaml scripts (.ml).


:information_desk_person: More information?

:scroll: License ? GitHub license

All the notebooks in this repository are published under the terms of the MIT License (file LICENSE.txt). © Lilian Besson, 2016-21.

Maintenance Ask Me Anything ! ForTheBadge uses-badges ForTheBadge uses-git ForTheBadge built-with-science