Jupyter notebook magic commands
A full list of IPython built-in magic commands can be found here. Line magics are prefixed with a single % character and apply to a single line, whereas cell magics are prefixed with %% character and apply to the entire cell. These are the ones that I always use.
- Use the inline backend for matplotlib.
import matplotlib.pyplot as plt
%matplotlib inline
- Automatically reload modules before executing code.
%load_ext autoreload
%autoreload 2
- Print elapsed time.
- Note: this is different from
%timeit
which calls the timeit module.
- Note: this is different from
%time