Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
plantillajupyterbook
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hackatón entrega Grupo 25
plantillajupyterbook
Commits
34b24a7d
Commit
34b24a7d
authored
1 year ago
by
David Akim
Browse files
Options
Downloads
Patches
Plain Diff
Update file notebooks.ipynb
parent
3f31b5d7
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
notebooks.ipynb
+0
-122
0 additions, 122 deletions
notebooks.ipynb
with
0 additions
and
122 deletions
notebooks.ipynb
deleted
100644 → 0
+
0
−
122
View file @
3f31b5d7
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Content with notebooks\n",
"\n",
"You can also create content with Jupyter Notebooks. This means that you can include\n",
"code blocks and their outputs in your book.\n",
"\n",
"## Markdown + notebooks\n",
"\n",
"As it is markdown, you can embed images, HTML, etc into your posts!\n",
"\n",
"\n",
"\n",
"You can also $add_{math}$ and\n",
"\n",
"$$\n",
"math^{blocks}\n",
"$$\n",
"\n",
"or\n",
"\n",
"$$\n",
"\\begin{aligned}\n",
"\\mbox{mean} la_{tex} \\\\ \\\\\n",
"math blocks\n",
"\\end{aligned}\n",
"$$\n",
"\n",
"But make sure you \\$Escape \\$your \\$dollar signs \\$you want to keep!\n",
"\n",
"## MyST markdown\n",
"\n",
"MyST markdown works in Jupyter Notebooks as well. For more information about MyST markdown, check\n",
"out [the MyST guide in Jupyter Book](https://jupyterbook.org/content/myst.html),\n",
"or see [the MyST markdown documentation](https://myst-parser.readthedocs.io/en/latest/).\n",
"\n",
"## Code blocks and outputs\n",
"\n",
"Jupyter Book will also embed your code blocks and output in your book.\n",
"For example, here's some sample Matplotlib code:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from matplotlib import rcParams, cycler\n",
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"plt.ion()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Fixing random state for reproducibility\n",
"np.random.seed(19680801)\n",
"\n",
"N = 10\n",
"data = [np.logspace(0, 1, 100) + np.random.randn(100) + ii for ii in range(N)]\n",
"data = np.array(data).T\n",
"cmap = plt.cm.coolwarm\n",
"rcParams['axes.prop_cycle'] = cycler(color=cmap(np.linspace(0, 1, N)))\n",
"\n",
"\n",
"from matplotlib.lines import Line2D\n",
"custom_lines = [Line2D([0], [0], color=cmap(0.), lw=4),\n",
" Line2D([0], [0], color=cmap(.5), lw=4),\n",
" Line2D([0], [0], color=cmap(1.), lw=4)]\n",
"\n",
"fig, ax = plt.subplots(figsize=(10, 5))\n",
"lines = ax.plot(data)\n",
"ax.legend(custom_lines, ['Cold', 'Medium', 'Hot']);"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"There is a lot more that you can do with outputs (such as including interactive outputs)\n",
"with your book. For more information about this, see [the Jupyter Book documentation](https://jupyterbook.org)"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.0"
},
"widgets": {
"application/vnd.jupyter.widget-state+json": {
"state": {},
"version_major": 2,
"version_minor": 0
}
}
},
"nbformat": 4,
"nbformat_minor": 4
}
%% Cell type:markdown id: tags:
# Content with notebooks
You can also create content with Jupyter Notebooks. This means that you can include
code blocks and their outputs in your book.
## Markdown + notebooks
As it is markdown, you can embed images, HTML, etc into your posts!

You can also $add_{math}$ and
$$
math^{blocks}
$$
or
$$
\b
egin{aligned}
\m
box{mean} la_{tex}
\\
\\
math blocks
\e
nd{aligned}
$$
But make sure you
\$
Escape
\$
your
\$
dollar signs
\$
you want to keep!
## MyST markdown
MyST markdown works in Jupyter Notebooks as well. For more information about MyST markdown, check
out
[
the MyST guide in Jupyter Book
](
https://jupyterbook.org/content/myst.html
)
,
or see
[
the MyST markdown documentation
](
https://myst-parser.readthedocs.io/en/latest/
)
.
## Code blocks and outputs
Jupyter Book will also embed your code blocks and output in your book.
For example, here's some sample Matplotlib code:
%% Cell type:code id: tags:
```
python
from
matplotlib
import
rcParams
,
cycler
import
matplotlib.pyplot
as
plt
import
numpy
as
np
plt
.
ion
()
```
%% Cell type:code id: tags:
```
python
# Fixing random state for reproducibility
np
.
random
.
seed
(
19680801
)
N
=
10
data
=
[
np
.
logspace
(
0
,
1
,
100
)
+
np
.
random
.
randn
(
100
)
+
ii
for
ii
in
range
(
N
)]
data
=
np
.
array
(
data
).
T
cmap
=
plt
.
cm
.
coolwarm
rcParams
[
'
axes.prop_cycle
'
]
=
cycler
(
color
=
cmap
(
np
.
linspace
(
0
,
1
,
N
)))
from
matplotlib.lines
import
Line2D
custom_lines
=
[
Line2D
([
0
],
[
0
],
color
=
cmap
(
0.
),
lw
=
4
),
Line2D
([
0
],
[
0
],
color
=
cmap
(.
5
),
lw
=
4
),
Line2D
([
0
],
[
0
],
color
=
cmap
(
1.
),
lw
=
4
)]
fig
,
ax
=
plt
.
subplots
(
figsize
=
(
10
,
5
))
lines
=
ax
.
plot
(
data
)
ax
.
legend
(
custom_lines
,
[
'
Cold
'
,
'
Medium
'
,
'
Hot
'
]);
```
%% Cell type:markdown id: tags:
There is a lot more that you can do with outputs (such as including interactive outputs)
with your book. For more information about this, see
[
the Jupyter Book documentation
](
https://jupyterbook.org
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment