binder/example.ipynb
Jupyter Notebook v7 is built using the same components as JupyterLab, and reuses a lot of the work from the JupyterLab community by leveraging the new prebuilt (federated) extension system.
Jupyter Notebook lets you navigate the files in a separate browser tab.
Go ahead and click on the Jupyter icon in the top left corner!
It will open a new browser tab with the listing of the files on the server:
It also shows the list of running sessions and terminals in the Running tab:
Alternatively it is also possible to access this page using the command in the View menu:
Jupyter Notebook also has support for editing files. Double-click on a file (or Right Click > Open) to open the editor:
To create a new Terminal, select File > New > Terminal in the menu:
The terminal opens in a new browser tab:
Jupyter Notebook includes a command palette, just like in JupyterLab.
Hit Ctrl-Shift-C or Accel-Shift-C to activate it. Or via the menu with View > Activate Command Palette:
Using the palette is very convenient and can give a significant productivity boost over time!
Since Jupyter Notebook v7 is heavily built on top of JupyterLab, it also has support for a Dark Mode! 🕶️
Go to Settings > Theme > JupyterLab Dark to select the theme:
New themes can be installed using the federated extension system. These themes will be compatible with both JupyterLab and Jupyter Notebook.
This is an exclusivity in Jupyter Notebook v7 😎
Activate the palette and choose Toggle Zen Mode. The interface will focus on the notebook and the notebook only!
Press Escape to exit, or re-run the Toggle Zen Mode command from the palette.
Jupyter Notebook v7 supports third-party extensions developed for JupyterLab 3.0+, using the new distribution system. These extensions can be installed via pip.
For example the extension to enable Jupyter Widgets rendering in both JupyterLab and Jupyter Notebook can be installed using the following command (run the cell):
!pip install ipywidgets
Now reload the page and resume from here. In the next section we will be able to create and use Jupyter Widgets!
Now let's instantiate a new widget:
from ipywidgets import IntSlider
slider = IntSlider()
slider
slider
Just like in many Jupyter Frontends, Jupyter Notebook supports rich display rendering. For example:
from IPython.display import Latex
Latex(
r"""\begin{eqnarray}
\nabla \times \vec{\mathbf{B}} -\, \frac1c\, \frac{\partial\vec{\mathbf{E}}}{\partial t} & = \frac{4\pi}{c}\vec{\mathbf{j}} \\
\nabla \cdot \vec{\mathbf{E}} & = 4 \pi \rho \\
\nabla \times \vec{\mathbf{E}}\, +\, \frac1c\, \frac{\partial\vec{\mathbf{B}}}{\partial t} & = \vec{\mathbf{0}} \\
\nabla \cdot \vec{\mathbf{B}} & = 0
\end{eqnarray}"""
)
Matplotlib figures:
import matplotlib.pyplot as plt
import numpy as np
x = np.linspace(0, 10, 100)
plt.plot(x, np.sin(x))
plt.plot(x, np.cos(x))
plt.show()
Or even HTML:
from IPython.display import HTML, display
s = """<table>
<tr>
<th>Header 1</th>
<th>Header 2</th>
</tr>
<tr>
<td>row 1, cell 1</td>
<td>row 1, cell 2</td>
</tr>
<tr>
<td>row 2, cell 1</td>
<td>row 2, cell 2</td>
</tr>
</table>"""
h = HTML(s)
display(h)
Hope you enjoyed the tour. If you have more question or any other issues, don't hesitate to go to the repository on GitHub!