An Example Notebook¶
This notebook is meant for testing conversion to other formats.
It contains Markdown cells and code cells with different kinds of outputs.
Markdown¶
We can write in italics (same with underscores), in boldface
(same with undescores) and [STRIKEOUT:strikethrough]. We also can
write preformatted text
.
Equations¶
Equations can be formatted really nicely, either inline, like \(\text{e}^{i\pi} = -1\), or on a separate line, like
Tables¶
A | B | A and B |
---|---|---|
False | False | False |
True | False | False |
False | True | False |
True | True | True |
Images¶
Jupyter notebook icon (local):
Python logo (local):
Jupyter logo (remote):
Python logo (remote):
Code Cells¶
An empty code cell:
A cell with no output:
None
A simple output:
6 * 7
42
The standard output stream:
print('Hello, world!')
Hello, world!
Normal output + standard output
print('Hello, world!')
6 * 7
Hello, world!
42
The standard error stream is highlighted and displayed just below the code cell. The standard output stream comes afterwards (with no special highlighting). Finally, the “normal” output is displayed.
import logging
logging.warning('I am a warning and I will appear on the standard error stream')
print('I will appear on the standard output stream')
'I am the "normal" output'
WARNING:root:I am a warning and I will appear on the standard error stream
I will appear on the standard output stream
'I am the "normal" output'
Special Display Formats¶
TODO: tables? e.g. Pandas DataFrame?
from IPython.display import display, Image, SVG, Math, YouTubeVideo
Local Image Files¶
i = Image(filename='images/notebook_icon.png')
i
display(i)
For some reason this doesn’t work with Image(...)
:
SVG(filename='images/python_logo.svg')
Image URLs¶
Image(url='https://www.python.org/static/img/python-logo-large.png')
Image(url='https://www.python.org/static/img/python-logo-large.png', embed=True)
Image(url='http://jupyter.org/assets/nav_logo.svg')
Image(url='https://www.python.org/static/favicon.ico')
Image(url='http://python.org/images/python-logo.gif')
Math¶
eq = Math(r"\int_{-\infty}^\infty f(x) \delta(x - x_0) dx = f(x_0)")
eq
display(eq)
%%latex
\begin{equation}
\int_{-\infty}^\infty f(x) \delta(x - x_0) dx = f(x_0)
\end{equation}
YouTubeVideo('iV2ViNJFZC8')