1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257
|
<document source="complex_outputs_unrun">
<container cell_index="0" cell_metadata="{'init_cell': True, 'slideshow': {'slide_type': 'skip'}}" classes="cell" exec_count="1" nb_element="cell_code">
<container classes="cell_input" nb_element="cell_code_source">
<literal_block language="ipython3" xml:space="preserve">
import pandas as pd
import sympy as sym
sym.init_printing(use_latex=True)
import numpy as np
from IPython.display import Latex
<section ids="markdown" names="markdown">
<title>
Markdown
<section ids="general" names="general">
<title>
General
<paragraph>
Some markdown text.
<paragraph>
A list:
<bullet_list bullet="-">
<list_item>
<paragraph>
something
<list_item>
<paragraph>
something else
<paragraph>
A numbered list
<enumerated_list enumtype="arabic" prefix="" suffix=".">
<list_item>
<paragraph>
something
<list_item>
<paragraph>
something else
<paragraph>
non-ascii characters TODO
<paragraph>
This is a long section of text, which we only want in a document (not a presentation)
some text
some more text
some more text
some more text
some more text
some more text
some more text
some more text
some more text
<paragraph>
This is an abbreviated section of the document text, which we only want in a presentation
<bullet_list bullet="-">
<list_item>
<paragraph>
summary of document text
<section ids="references-and-citations" names="references\ and\ citations">
<title>
References and Citations
<paragraph>
References to \cref{fig:example}, \cref{tbl:example}, =@eqn:example_sympy and \cref{code:example_mpl}.
<paragraph>
A latex citation.\cite{zelenyak_molecular_2016}
<paragraph>
A html citation.
<raw format="html" xml:space="preserve">
<cite data-cite="kirkeminde_thermodynamic_2012">
(Kirkeminde, 2012)
<raw format="html" xml:space="preserve">
</cite>
<section ids="todo-notes" names="todo\ notes">
<title>
Todo notes
<paragraph>
\todo[inline]{an inline todo}
<paragraph>
Some text.\todo{a todo in the margins}
<section ids="text-output" names="text\ output">
<title>
Text Output
<container cell_index="11" cell_metadata="{'ipub': {'text': {'format': {'backgroundcolor': '\\color{blue!10}'}}}}" classes="cell" exec_count="2" nb_element="cell_code">
<container classes="cell_input" nb_element="cell_code_source">
<literal_block language="ipython3" xml:space="preserve">
print("""
This is some printed text,
with a nicely formatted output.
""")
<container classes="cell_output" nb_element="cell_code_output">
<literal_block classes="output stream" language="myst-ansi" xml:space="preserve">
This is some printed text,
with a nicely formatted output.
<section ids="images-and-figures" names="images\ and\ figures">
<title>
Images and Figures
<section ids="displaying-a-plot-with-its-code" names="displaying\ a\ plot\ with\ its\ code">
<title>
Displaying a plot with its code
<paragraph>
A matplotlib figure, with the caption set in the markdowncell above the figure.
<paragraph>
The plotting code for a matplotlib figure (\cref{fig:example_mpl}).
<section ids="tables-with-pandas" names="tables\ (with\ pandas)">
<title>
Tables (with pandas)
<paragraph>
The plotting code for a pandas Dataframe table (\cref{tbl:example}).
<container cell_index="18" cell_metadata="{'ipub': {'code': {'asfloat': True, 'caption': '', 'label': 'code:example_pd', 'placement': 'H', 'widefigure': False}, 'table': {'alternate': 'gray!20', 'caption': 'An example of a table created with pandas dataframe.', 'label': 'tbl:example', 'placement': 'H'}}}" classes="cell" exec_count="3" nb_element="cell_code">
<container classes="cell_input" nb_element="cell_code_source">
<literal_block language="ipython3" xml:space="preserve">
np.random.seed(0)
df = pd.DataFrame(np.random.rand(3, 4), columns=["a", "b", "c", "d"])
df.a = [r"$\delta$", "x", "y"]
df.b = ["l", "m", "n"]
df.set_index(["a", "b"])
df.round(3)
<container classes="cell_output" nb_element="cell_code_output">
<container nb_element="mime_bundle">
<container mime_type="text/plain">
<literal_block classes="output text_plain" language="myst-ansi" xml:space="preserve">
a b c d
0 $\delta$ l 0.603 0.545
1 x m 0.438 0.892
2 y n 0.792 0.529
<container mime_type="text/html">
<raw classes="output text_html" format="html" xml:space="preserve">
<div>
<style scoped>
.dataframe tbody tr th:only-of-type {
vertical-align: middle;
}
.dataframe tbody tr th {
vertical-align: top;
}
.dataframe thead th {
text-align: right;
}
</style>
<table border="1" class="dataframe">
<thead>
<tr style="text-align: right;">
<th></th>
<th>a</th>
<th>b</th>
<th>c</th>
<th>d</th>
</tr>
</thead>
<tbody>
<tr>
<th>0</th>
<td>$\delta$</td>
<td>l</td>
<td>0.603</td>
<td>0.545</td>
</tr>
<tr>
<th>1</th>
<td>x</td>
<td>m</td>
<td>0.438</td>
<td>0.892</td>
</tr>
<tr>
<th>2</th>
<td>y</td>
<td>n</td>
<td>0.792</td>
<td>0.529</td>
</tr>
</tbody>
</table>
</div>
<section ids="equations-with-ipython-or-sympy" names="equations\ (with\ ipython\ or\ sympy)">
<title>
Equations (with ipython or sympy)
<container cell_index="20" cell_metadata="{'ipub': {'equation': {'label': 'eqn:example_ipy'}}}" classes="cell" exec_count="4" nb_element="cell_code">
<container classes="cell_input" nb_element="cell_code_source">
<literal_block language="ipython3" xml:space="preserve">
Latex("$$ a = b+c $$")
<container classes="cell_output" nb_element="cell_code_output">
<container nb_element="mime_bundle">
<container mime_type="text/plain">
<literal_block classes="output text_plain" language="myst-ansi" xml:space="preserve">
<IPython.core.display.Latex object>
<container mime_type="text/latex">
<math_block classes="output text_latex" nowrap="False" number="True" xml:space="preserve">
a = b+c
<paragraph>
The plotting code for a sympy equation (=@eqn:example_sympy).
<container cell_index="22" cell_metadata="{'ipub': {'code': {'asfloat': True, 'caption': '', 'label': 'code:example_sym', 'placement': 'H', 'widefigure': False}, 'equation': {'environment': 'equation', 'label': 'eqn:example_sympy'}}}" classes="cell" exec_count="5" nb_element="cell_code">
<container classes="cell_input" nb_element="cell_code_source">
<literal_block language="ipython3" xml:space="preserve">
y = sym.Function("y")
n = sym.symbols(r"\alpha")
f = y(n) - 2 * y(n - 1 / sym.pi) - 5 * y(n - 2)
sym.rsolve(f, y(n), [1, 4])
<container classes="cell_output" nb_element="cell_code_output">
<container nb_element="mime_bundle">
<container mime_type="text/plain">
<literal_block classes="output text_plain" language="myst-ansi" xml:space="preserve">
\alpha ⎛1 2⋅√5⋅ⅈ⎞ \alpha ⎛1 2⋅√5⋅ⅈ⎞
(√5⋅ⅈ) ⋅⎜─ - ──────⎟ + (-√5⋅ⅈ) ⋅⎜─ + ──────⎟
⎝2 5 ⎠ ⎝2 5 ⎠
<container mime_type="image/png">
<image candidates="{'*': '_build/jupyter_execute/9bc81205a14646a235d284d1b68223d17f30f7f1d3d8ed3e52cf47830b02e3bb.png'}" uri="_build/jupyter_execute/9bc81205a14646a235d284d1b68223d17f30f7f1d3d8ed3e52cf47830b02e3bb.png">
<container mime_type="text/latex">
<math_block classes="output text_latex" nowrap="False" number="True" xml:space="preserve">
\displaystyle \left(\sqrt{5} i\right)^{\alpha} \left(\frac{1}{2} - \frac{2 \sqrt{5} i}{5}\right) + \left(- \sqrt{5} i\right)^{\alpha} \left(\frac{1}{2} + \frac{2 \sqrt{5} i}{5}\right)
<section ids="interactive-outputs" names="interactive\ outputs">
<title>
Interactive outputs
<section ids="ipywidgets" names="ipywidgets">
<title>
ipywidgets
<container cell_index="24" cell_metadata="{}" classes="cell" exec_count="6" nb_element="cell_code">
<container classes="cell_input" nb_element="cell_code_source">
<literal_block language="ipython3" xml:space="preserve">
import ipywidgets as widgets
widgets.Layout(model_id="1337h4x0R")
<container classes="cell_output" nb_element="cell_code_output">
<container nb_element="mime_bundle">
<container mime_type="text/plain">
<literal_block classes="output text_plain" language="myst-ansi" xml:space="preserve">
Layout()
<container mime_type="application/vnd.jupyter.widget-view+json">
<raw format="html" xml:space="preserve">
<script type="application/vnd.jupyter.widget-view+json">{"version_major": 2, "version_minor": 0, "model_id": "1337h4x0R"}</script>
<container cell_index="25" cell_metadata="{}" classes="cell" exec_count="7" nb_element="cell_code">
<container classes="cell_input" nb_element="cell_code_source">
<literal_block language="ipython3" xml:space="preserve">
from IPython.display import display, Markdown
display(Markdown("**_some_ markdown**"))
<container classes="cell_output" nb_element="cell_code_output">
<container nb_element="mime_bundle">
<container mime_type="text/plain">
<literal_block classes="output text_plain" language="myst-ansi" xml:space="preserve">
<IPython.core.display.Markdown object>
<container mime_type="text/markdown">
<paragraph>
<strong>
<emphasis>
some
markdown
|