From charlesreid1

Revision as of 11:28, 2 December 2017 by Admin (talk | contribs) (→‎Notebook lists)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Jupyter Notebooks

(There is some old information on the Ipython page but this is the one that's updated regularly)

Jupyter Notebooks provide access to the Python programming language through a web browser interface.

List of Jupyter notebooks

Long list of links to interesting notebooks: Jupyter/List

Notebook lists

Jupyter/List

ipython/ipyparallel client: https://nbviewer.jupyter.org/gist/minrk/4470122

ipython documentation: https://ipython.readthedocs.io/en/stable/index.html?highlight=session

ipython notebook cookbook: https://ipython-books.github.io/cookbook/

stochastic methods for data analysis, inference, and optimization: https://am207.github.io/2016/

ipython notebook gallery: https://github.com/ipython/ipython/tree/41bc8e5ec492820b32f60122dd178300f7e01240

Creating Profiles

Jupyter/Profiles

Using Extensions

Jupyter/Extensions

Running code in parallel with ipyparallel

See Jupyter/MPI for instructions on setting up and running code in parallel using Jupyter notebooks.

Pickling things with Dill

See Jupyter/Dill for use of dill to pickle stuff.

The dill library adds pickling/serialization abilities to the ipython parallel functionality.

Setting up password-protected Jupyter notebook

If you just want a single-user password-protected Jupyter notebook, you can modify Jupyter's config file, jupyter_notebook_config.py, to contain a hashed password. Then, when you run it, Jupyter will load the configuration file and password-protect the notebook that it starts up. Here's how to do that:

Create config file

Start by running a Jupyter command that will create a new, empty config file:

$ jupyter notebook --generate-config

The file it creates is called jupyter_notebook_config.json. Once you generate the hashed password, this is where you'll add it.

Generate hashed password

You can generate a hashed password by interactively entering your password on the command line, live:

$ jupyter notebook password
Enter password: *******
Verify password: *******
[NotebookPasswordApp] Wrote hashed password to /Users/you/.jupyter/jupyter_notebook_config.json

Alternatively, you can generate the hash yourself, or in a script, using components of Juypter notebook from a Python script:

>>> from notebook.auth import passwd
>>> passwd()
Enter password:
Verify password:
'sha1:8c8fe60bb8b6:ccf9ede0825894254b2e042ea597d77107ee11abd'

Or from a Python script:

from notebook.auth import passwd
passwd('the_worst_password_in_the_world')