|
1 | 1 | <document source="complex_outputs_unrun"> |
2 | 2 | <CellNode cell_type="code" classes="cell"> |
3 | 3 | <CellInputNode classes="cell_input"> |
4 | | - <literal_block xml:space="preserve"> |
| 4 | + <literal_block language="ipython3" xml:space="preserve"> |
5 | 5 | import matplotlib.pyplot as plt |
6 | 6 | import pandas as pd |
7 | 7 | pd.set_option('display.latex.repr', True) |
|
89 | 89 | Text Output |
90 | 90 | <CellNode cell_type="code" classes="cell"> |
91 | 91 | <CellInputNode classes="cell_input"> |
92 | | - <literal_block xml:space="preserve"> |
| 92 | + <literal_block language="ipython3" xml:space="preserve"> |
93 | 93 | print(""" |
94 | 94 | This is some printed text, |
95 | 95 | with a nicely formatted output. |
|
113 | 113 | The plotting code for a pandas Dataframe table (\cref{tbl:example}). |
114 | 114 | <CellNode cell_type="code" classes="cell"> |
115 | 115 | <CellInputNode classes="cell_input"> |
116 | | - <literal_block xml:space="preserve"> |
| 116 | + <literal_block language="ipython3" xml:space="preserve"> |
117 | 117 | np.random.seed(0) |
118 | 118 | df = pd.DataFrame(np.random.rand(3,4),columns=['a','b','c','d']) |
119 | 119 | df.a = ['$\delta$','x','y'] |
|
127 | 127 | Equations (with ipython or sympy) |
128 | 128 | <CellNode cell_type="code" classes="cell"> |
129 | 129 | <CellInputNode classes="cell_input"> |
130 | | - <literal_block xml:space="preserve"> |
| 130 | + <literal_block language="ipython3" xml:space="preserve"> |
131 | 131 | Latex('$$ a = b+c $$') |
132 | 132 | <CellOutputNode classes="cell_output"> |
133 | 133 | <CellOutputBundleNode output_count="1"> |
134 | 134 | <paragraph> |
135 | 135 | The plotting code for a sympy equation (=@eqn:example_sympy). |
136 | 136 | <CellNode cell_type="code" classes="cell"> |
137 | 137 | <CellInputNode classes="cell_input"> |
138 | | - <literal_block xml:space="preserve"> |
| 138 | + <literal_block language="ipython3" xml:space="preserve"> |
139 | 139 | y = sym.Function('y') |
140 | 140 | n = sym.symbols(r'\alpha') |
141 | 141 | f = y(n)-2*y(n-1/sym.pi)-5*y(n-2) |
|
150 | 150 | ipywidgets |
151 | 151 | <CellNode cell_type="code" classes="cell"> |
152 | 152 | <CellInputNode classes="cell_input"> |
153 | | - <literal_block xml:space="preserve"> |
| 153 | + <literal_block language="ipython3" xml:space="preserve"> |
154 | 154 | import ipywidgets as widgets |
155 | 155 | widgets.Layout(model_id="1337h4x0R") |
156 | 156 | <CellOutputNode classes="cell_output"> |
|
0 commit comments