Skip to content

๐Ÿ““ A growing collection of Jupyter Notebooks written in Python, OCaml and Julia for science examples, algorithms, visualizations etc

License

Notifications You must be signed in to change notification settings

Naereen/notebooks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

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 ๐Ÿ‡ฌ๐Ÿ‡ง English, and the other half in ๐Ÿ‡ซ๐Ÿ‡ท 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

  • At the beginning (as early as end of 2015!), this repository was only here to host some small experiments, for me to learn how to use the wonderful Jupyter tools correctly. So they were baby notebooks ๐Ÿผ... Since then, I did a lot of experiments, on all the most important kernels (Python, Julia, but also less standard ones like OCaml, Rust, Java, C, Bash, etc), all the most exciting notebook extensions, and output formats (PDF, script, static HTML, slides, etc). I've kept learning and discovering more awesomeness of the Jupyter environment, and it never stops to amaze me โœจ!

  • In the last 5 years (2016-2021), I've used Jupyter notebooks intensively, to teach algorithmics, programming, and (not so theoretical) computer science in general, mainly in ๐Ÿ‡ซ๐Ÿ‡ท French. I wrote notebooks to teach introduction to Java in 2020, advanced algorithms using Python in 2019, and a lot for experimenting during my PhD thesis.

  • ๐Ÿ‡ซ๐Ÿ‡ท J'ai aussi corrigรฉ tous les textes d'annales de modรฉlisation, en option informatique, pour le concours national de l'agrรฉgation de maths, en utilisant OCaml ou des fois Python ! Ce sont les seuls corrigรฉs de ce type disponibles sur tous les Internets (j'ai cherchรฉ partout !), et ils sont dans ce dossier : agreg/. Je compte dรฉplacer รงa dans un dossier ร  part, et bien les nettoyer et mettre ร  jour, en 2021.

  • I love the Jupyter environment, from the old IPython command line to the recent awesome Jupyter Lab. If you want to discover amazing things, check out: RISE for live slides in a notebook, lolviz and rcviz and tutormagic for nice data structures visualizations in a notebook.

  • In the future, I plan to mostly teach using Jupyter notebooks, using either the regular Python kernel, the OCaml-jupyter kernel for OCaml (and also IJava for Java, this one for C, and more if needed). RISE slides embed a chalk-board mode, more limited in comparison to the amazing TableauNoir.

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).

๐Ÿš Bash

๐Ÿ Python

I am a passionate user of the Python programming language.

Science

Teaching

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

๐ŸŽจ 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! ๐Ÿš…

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


1. How to read these documents?

1.a. View the notebooks statically ๐Ÿ“

1.b. Play with the notebooks dynamically ๐Ÿ’ฅ

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).

โš ๏ธ I've not updated this section since 2016.

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):

$ bash --version | head -n1
GNU bash, version 4.3.42(1)-release (x86_64-pc-linux-gnu)
  • And then install the kernel bash_kernel with these two commands:
sudo pip install bash_kernel
python -m bash_kernel.install
  • You have to have octave installed (installable with the package manager on major Linux distributions (apt-get, pacman, yum etc), installable with brew or macports on Mac OS, available on Windows through cygwin or natively):
$ octave --version | head -n1
GNU Octave, version 4.0.0
  • Your version of Octave should be installed with gnuplot support (it is usually the case):
$ gnuplot --version | head -n1
gnuplot 5.0 patchlevel 1
  • And then install the kernel bash_kernel with these two commands:
sudo pip install octave_kernel
python -m octave_kernel.install

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).


๐Ÿ’ More information?

๐Ÿ“œ 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