jupyter ipython notebooks


ipython is interactive python (ipython notebook page). It's slightly slower than regular python, but it has handy features. For example, ipython recognises common UNIX commands like pwd. Also, it supports autocomplete. Finally, it can be used to create ipython notebooks, which are graphical mathematica-style notebooks, which open in web browsers and execute python commands in order to make embedded plots.

opening ipython notebooks: ipython notebook Omega_Freq_Plot.ipynb

LIGO GitLab: https://git.ligo.org/colm.talbot

To download an ipynb file from gitlab, click on the file, look for a button near the top to "open raw." Now, option-return and the file will download as file.ipynb.txt. Remove the .txt ending.

Run the named file inside ipython as a program (magic command): %run try.py

ipython installation: instructions
Also, see these instructions for running example_wave_generation.ipynb in the getting started with LAL instructions.

How do I convert ipython notebooks to regular python?
ipython nbconvert --to python ./vivien/example_wave_generation.ipynb
Another option is to open your ipython notebook, click file > save as

How do I run ipython/python scripts from within ipython?
run example_wave_generation

Open a blank jupyter notebook: ipython notebook
Then, RHS > new > python 2

install/upgrade jupyter: pip install jupyter --upgrade --user


What if I get an error that ipython is not found?
You can also call ipython like this:
python -m IPython notebook example_wave_generation.ipynb


Back to Resources