Skip to content
Snippets Groups Projects
Commit a4dd585d authored by Jens Henrik Goebbert's avatar Jens Henrik Goebbert
Browse files

new stuff

parent f1dfecb9
No related branches found
No related tags found
No related merge requests found
%% Cell type:markdown id:mounted-terror tags:
# JupyterLab Tour
This is the first time you are using JupyterLab? Let us have a look at the user interface and some general concepts.
-------------------------
%% Cell type:markdown id:intense-alloy tags:
### Exporting Jupyter Notebooks: nbconvert
[more](https://nbconvert.readthedocs.io/en/latest/)
---------------------------------------------
%% Cell type:markdown id:moved-security tags:
#### Exercise 1:
1. Export this notebook to
- PDF
- images as attachments are not supported
- Markdown
- Output is included PNG
- HTML
%% Cell type:code id:demographic-pendant tags:
``` python
%matplotlib inline
from matplotlib import pyplot as plt
from matplotlib import style
import numpy as np
import pandas as pd
data = {
'x': np.random.rand(200),
'y': np.random.rand(200),
'color': np.random.rand(200),
'size': 100.0*np.random.rand(200)
}
df = pd.DataFrame(data)
```
%% Cell type:code id:detailed-russian tags:
``` python
style.use('seaborn-whitegrid')
plt.scatter('x', 'y', c='color', s='size', data=df, cmap=plt.cm.Blues)
plt.xlabel('x')
plt.ylabel('y')
plt.title('Plotted with Matplotlib')
```
%% Output
Text(0.5, 1.0, 'Plotted with Matplotlib')
%% Cell type:markdown id:still-polish tags:
#### Exercise 2:
1. Create "Output View"
2. Show it is in synch with notebook output
%% Cell type:markdown id:sensitive-office tags:
#### Exercise 3:
1. Execute code from a Markdown file
- Context Menu -> Create Console for Editor
- Mark lines + `SHIFT+Enter`
2. Drag code from console to Markdown file
3. Stop kernel of Markdown file
%% Cell type:markdown id:induced-wheel tags:
#### Exercise 4:
- Use Papermill to run your notebooks
- Check SanityCheck-Tutorials.ipynb for more
%% Cell type:code id:armed-socket tags:
``` python
import os
import papermill as pm
from papermill.exceptions import PapermillExecutionError
cwd = os.getcwd()
print(cwd)
try:
nb = pm.execute_notebook(
os.path.join(cwd, 'example.ipynb'),
os.path.join(cwd, 'papermill_example.ipynb'),
#kernel_name="Python3"
)
except:
print("FAILED !!!!")
```
%% Output
/home/jovyan/prace-2021.04-jupyter4hpc_solutions/day2/0-welcome
%% Cell type:markdown id:inner-warning tags:
#### Exercise 5:
- Show hidden files in the file browser
- not possible, yet
- https://github.com/jupyterlab/jupyterlab/issues/2049
%% Cell type:code id:vertical-magnet tags:
``` python
```
File added
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment