Jupyter-to-Tex/Example.tex

104 lines
2.7 KiB
TeX

\hypertarget{first-headline}{%
\section{First headline}\label{first-headline}}
Some nice text!
\hypertarget{0c9dbddc-f5f5-4f58-a2e2-dfff0faf517f}{}
\begin{minipage}{1.0\textwidth}
\begin{lstlisting}[language=iPython]
!pip install pandas==1.5.2 -q
!pip install matplotlib==3.6.2 -q
\end{lstlisting}
\end{minipage}
\begin{lstlisting}
[notice] A new release of pip available: 22.3 -> 22.3.1
[notice] To update, run: python.exe -m pip install --upgrade pip
[notice] A new release of pip available: 22.3 -> 22.3.1
[notice] To update, run: python.exe -m pip install --upgrade pip
\end{lstlisting}
\leavevmode\vadjust pre{\hypertarget{8f41454c-0bf0-4e53-992b-34fb47bf7dd1}{}}%
Import the classes necessary to run the software.
\hypertarget{5c4c7d02-c06b-49c3-a6e6-9819e9eae44b}{}
\begin{minipage}{1.0\textwidth}
\begin{lstlisting}[language=iPython]
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
\end{lstlisting}
\end{minipage}
\leavevmode\vadjust pre{\hypertarget{2e5173f8-7c64-40f4-8fbe-e3bf28ad96a3}{}}%
A bit of sample code!
\hypertarget{66ada60d-8a49-473b-bc38-a40999ba761a}{}
\begin{minipage}{1.0\textwidth}
\begin{lstlisting}[language=iPython]
a = 1
for i in range(1, 10):
a *= i
a
\end{lstlisting}
\end{minipage}
\begin{lstlisting}
362880
\end{lstlisting}
\leavevmode\vadjust pre{\hypertarget{3dbc2840-9793-4a92-802b-78d0b333e632}{}}%
Acces a document by key.
\hypertarget{5e5fd8c8-200f-4857-b63d-1172b842f11c}{}
\begin{minipage}{1.0\textwidth}
\begin{lstlisting}[language=iPython]
# get a document by key
some_dict = {"test": 1, "more content": "some_more1", "more content1": "some_more2"}
some_dict
\end{lstlisting}
\end{minipage}
\begin{lstlisting}
{'test': 1, 'more content': 'some_more1', 'more content1': 'some_more2'}
\end{lstlisting}
\leavevmode\vadjust pre{\hypertarget{e818c095-e2d9-40c7-9234-ceddcb27cddb}{}}%
Pandas Example!
\hypertarget{8eb6d0be-9fc0-4c89-ad18-801c0349d5cc}{}
\begin{minipage}{1.0\textwidth}
\begin{lstlisting}[language=iPython]
df = pd.DataFrame([some_dict] * 10)
df.head()
\end{lstlisting}
\end{minipage}
\begin{tabular}{lrll}
\toprule
{} & test & more content & more content1 \\
\midrule
0 & 1 & some\_more1 & some\_more2 \\
1 & 1 & some\_more1 & some\_more2 \\
2 & 1 & some\_more1 & some\_more2 \\
3 & 1 & some\_more1 & some\_more2 \\
4 & 1 & some\_more1 & some\_more2 \\
\bottomrule
\end{tabular}
\hypertarget{c1237c23-2ab4-4fa0-9895-0691c20827b6}{}
\begin{minipage}{1.0\textwidth}
\begin{lstlisting}[language=iPython]N = 400
t = np.linspace(0, 2 * np.pi, N)
r = 0.5 + np.cos(t)
x, y = r * np.cos(t), r * np.sin(t)
fig, ax = plt.subplots()
ax.plot(x, y, "k")
ax.set(aspect=1)
plt.show()
\end{lstlisting}
\end{minipage}