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
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!
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:
MyBinder should work fine even for OCaml notebooks, but it's quite slow. It's fully open-source, and reliable:
Google Colab should work only for Python notebooks, but it's blazing fast to load. It's not open-source and requires to use Google's servers:
New! In Feb'21, I have installed the amazing Basthon notebook to my website, at http://notebook.besson.link/, and you can use it with any of the notebooks available in the repository, for instance https://besson.link/Basthon/notebook/?from=../../publis/notebooks/Py_Pi_Day_2017.ipynb for Py_Pi_Day_2017.ipynb
, because this folder is synced on my website at https://besson.link/publis/notebooks/. Please open an issue if this doesn't work!
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
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
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.
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
commands (or some of my command-line scripts), see for example a tutorial on head and a tail (on GitHub?).I am a passionate user of the Python programming language.
This notebook written for the Pi Day 2017 (on GitHub?) demonstrates a dozen of easy algorithms to compute from 10 to 100000 digits of the number pi.
This notebook implements a simple example of the simulated annealing algorithm (on GitHub?) to minimize black-box functions
This notebook shows a hand-written and clear implementation (on GitHub?) of several Hashing functions, like MD5
, SHA1
, and all variants of SHA2
(SHA256
, SHA224
, SHA512
, SHA384
).
This notebook shows a manual implementation (on GitHub?) of the Lempel-Ziv complexity in pure Python, and then as optimized Python code, with Cython or Numba. I also wrote a version in Julia (in the same notebook), and compare the 4 implementations! I then published my code as a Pypy package, see here on pypi.org.
This notebook shows a hand-written and clear implementation (on GitHub?) of several Pseudo-Random Number Generators, including the famous Mersenne twister algorithm, and then uses it to samples from the most famous discrete and continuous distributions, showcasing use of the Inverse-Transform method and Acceptance-Rejection method (cf. Markov Chain Monte-Carlo methods).
This notebook implements and compares different Runge-Kutta methods (on GitHub?) for integrating Ordinary Differential Equations in Python. And also in Julia (on GitHub?), and also in OCaml (on GitHub?). I wanted to compare the three languages for the same algorithms. Well, obviously, Julia is the fastest and simplest for numerical simulations like this.
This notebook implements and explore the Exponential Integral function Ei(x) (on GitHub?).
This notebook shows how to solve the equation exp(- a x²)=x
both numerically and formally (with the Lambert W function) (on GitHub?).
This notebook implements Kullback-Leibler divergences for some parametric distributions, and KL-UCB indexes, in naive Python and compare with optimized versions using JIT compilation by Numba or C compilation by Cython (on GitHub?).
This short notebook defines and studies the Rényi entropy (on GitHub?).
Work in progress?
(je ne terminerai pas, c'est trop compliqué de faire ça parfaitement)
This long but easy to follow notebook explains how to solve the regular expression cross-words from this website, as I was struggling to solve this difficult one (Volapük Lul) (on GitHub?)
This small notebook (on GitHub?) is a fun experiment, where I tried to use James Powell (@dutc) rwatch module to write a Python context manager to add a Gaussian white noise to every numbers inside the context... Something like: with noise(): x = 10
will produce x = 10.325
for instance... It fails, but I almost got it, and it works (without breaking the interpreter) for complex numbers. That's already intersting!
This notebook (on GitHub?) is a small experiment, written quickly, about floating-point error propagation when using a non-naive polynomial multiplication with evaluation-and-interpolation. Sadly, this approach fails!
A tiny presentation on how to do time/memory profiling (on GitHub?) from inside the Jupyter notebook interface, with various approaches.
lolviz
module in 2017 (on GitHub?), and then again in 2021, to improve it, with a unified display function that chooses the best one based on the datatype (on GitHub?).
This notebook shows how to register a custom HTML writer for builtins or user-defined types in IPython and Jupyter (on GitHub?), for the sake of the example I wrote a nice LaTeX/MathJax-powered print function that nicely displays polynomials from the numpy.polynomial.Polynomial
module or class.
A small benchmark between Python, Pypy and Julia for the Romberg numerical integration algorithm (on GitHub?). Julia is the fastest, but Pypy is very fast too
Demo of the RISE Jupyter extension to easily write a dynamic slideshow in a Jupyter notebook, for Python (on GitHub?) andfor OCaml (on GitHub?)
tutormagic
et nbtutor
dans ce notebook (20/02/2021) (on GitHub?)
nbtutor
extension offline this other tiny notebook (20/02/2021) (on GitHub?) - Failure! TODO:
And more will come... soon!
��
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:
MyBinder should work fine even for OCaml notebooks, but it's quite slow. It's fully open-source, and reliable:
Google Colab should work only for Python notebooks, but it's blazing fast to load. It's not open-source and requires to use Google's servers:
New! In Feb'21, I have installed the amazing Basthon notebook to my website, at http://notebook.besson.link/, and you can use it with any of the notebooks available in the repository, for instance https://besson.link/Basthon/notebook/?from=../../publis/notebooks/Py_Pi_Day_2017.ipynb for Py_Pi_Day_2017.ipynb
, because this folder is synced on my website at https://besson.link/publis/notebooks/. Please open an issue if this doesn't work!
Note: Only the Python kernel is supported on the MyBinder interface!
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
andpython
bypip3
andpython3
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
They are only needed to run the notebooks written for Bash or Octave (or OCaml):
bash
installed (already there on all Linux distribution, installable with brew
or macports
on Mac OS, available on Windows through cygwin
):$ bash --version | head -n1
GNU bash, version 4.3.42(1)-release (x86_64-pc-linux-gnu)
bash_kernel
with these two commands:sudo pip install bash_kernel
python -m bash_kernel.install
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
$ gnuplot --version | head -n1
gnuplot 5.0 patchlevel 1
bash_kernel
with these two commands:sudo pip install octave_kernel
python -m octave_kernel.install
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 customExporter
forjupyter-nbconvert
in order to convert the notebooks to OCaml scripts (.ml
).
- More information about notebooks (on the documentation of IPython) or on the FAQ on Jupyter's website.
- More information about mybinder.org: on this example repository.
���� Plus d'informations sur Basthon : https://basthon.fr/about.html
All the notebooks in this repository are published under the terms of the MIT License (file LICENSE.txt).© Lilian Besson, 2016-21.
我已经用深度学习虚拟机(Microsoft Azure)设置了一个虚拟机。 通常,我通过ssh等连接到vm 然后我通过编写 我怎样才能解决这个问题? 谢谢你的帮助!
NoteBooks Statistics and Machine Learning Notebooks as published on unsupervised-learning.com (RIP).
data-science-ipython-notebooks Index deep-learning tensorflow theano keras caffe scikit-learn statistical-inference-scipy pandas matplotlib numpy python-data kaggle-and-business-analyses spark mapredu
Try out deep learning models online on Colab with a single click. TTS An English female voice (LJSpeech) demo using NVIDIA/tacotron2 and NVIDIA/waveglow LibriTTS trained multi speaker TTS demo using N
SparkR Notebooks This is a collection of Jupyternotebooks intended to train the reader on different Apache Spark concepts, frombasic to advanced, by using the R language. If your are interested in bei
Run Node.js code in Jupyter notebooks Notebooks are where data scientists process, analyse, and visualise data in an iterative, collaborative environment. They typically run environments for languages