From dd9eb2bffebf4a051dc36d778859659c0fd11387 Mon Sep 17 00:00:00 2001 From: Arnaud Legrand Date: Wed, 5 Sep 2018 11:32:13 +0200 Subject: [PATCH] Regenerate HTML, push to FUN --- module2/ressources/jupyter.html | 111 +++++++++++++++++--------------- 1 file changed, 58 insertions(+), 53 deletions(-) diff --git a/module2/ressources/jupyter.html b/module2/ressources/jupyter.html index 7406f80..e6040b4 100644 --- a/module2/ressources/jupyter.html +++ b/module2/ressources/jupyter.html @@ -4,22 +4,22 @@

Table of Contents

-
-

Additional Jupyter resources or tricks

-
+
+

Additional Jupyter resources or tricks

+
-
-

Tips and tricks

-
+
+

Tips and tricks

+

The following webpage lists several Jupyter tricks (in particular, it illustrates many Ipython magic commands) that should improve your @@ -44,9 +44,9 @@ now).

-
-

Running R and Python in the same notebook

-
+
+

Running R and Python in the same notebook

+

The best solution to this is to install rpy2. On my machine, I have installed the python3-rpy2 debian package with apt-get install. E.g., @@ -56,8 +56,8 @@ installed the python3-rpy2 debian package with apt-get instal

-An other (not really recommanded) alternative consists in going -through the python package manager with +An other (not really recommended if the first one is available) +alternative consists in going through the python package manager with

pip3 install rpy2
@@ -78,7 +78,7 @@ Loading rpy2:
 Using the %R Ipython magic:
 

-
%R 
+
%%R 
 summary(cars)
 
@@ -92,11 +92,16 @@ plot(df)
+

+Note that this %%R notation allows you to use R for the whole cell but +an other possibility is to use %R to have a single line of R within a +python cell. +

-
-

Exporting a notebook

-
+
+

Exporting a notebook

+

Obviously, you can convert to html or pdf using the using the File > Download as > HTML (or PDF) menu option. This can also be done from @@ -109,27 +114,27 @@ the command line with the following command:

-If you want to use a specific style, then the nbconvert exporter -should be customised. This is discussed and demoed here. We encourage +If you want to use a specific style, then the nbconvert exporter +should be customized. This is discussed and demoed here. We encourage you to simply read the doc of nbconvert.

Instead of going directly through LaTeX and playing too much with the -nbconvert exporter, an other option consists in exporting to Markdown +nbconvert exporter, an other option consists in exporting to Markdown and playing with pandoc. Both approaches work, it's rather a matter of taste.

-
-

Installing Jupyter on your own machine

-
+
+

Installing Jupyter on your own machine

+
-
-

Installing Jupyter

-
+
+

Installing Jupyter

+

Follow these instructions if you wish to have a Jupyter environment on your own machine similar to the one we set up for this MOOC. @@ -161,9 +166,9 @@ jupyter notebook

-
-

Side note about Jupyter, JupyterLab, JupyterHub, …

-
+
+

Side note about Jupyter, JupyterLab, JupyterHub, …

+

Note that Jupyter notebooks are only a small part of the picture and that Jupyter is now part of a bigger project: JupyterLab, which allows @@ -175,9 +180,9 @@ cutting-edge Jupyter notebooks.

-
-

Exporting your notebooks with latex

-
+
+

Exporting your notebooks with latex

+

Here is what we had to install on our recent debian machine to make sure the notebook export via latex works: @@ -189,13 +194,13 @@ the notebook export via latex works:

-
-

Jupyter extensions/plugins

-
+
+

Jupyter extensions/plugins

+
-
-

Improving notebook readability

-
+
+

Improving notebook readability

+

Here are a few extensions that can ease your life:

@@ -221,9 +226,9 @@ jupyter-serverextension enable --py hide_code
-
-

Interacting with GitLab and GitHub

-
+
+

Interacting with GitLab and GitHub

+

To ease your experience, we added some pull/push buttons that allow you to commit and sync with GitLab. This development was specific to @@ -239,14 +244,14 @@ This being said, you may have noticed that Jupyter keeps a perfect track of the sequence in which cells have been run by updating the "output index". This is a very good property from the reproducibility point of view but depending on your usage, you may find it a bit -painful when commiting. Some people have thus developped specific git -hooks to ignore these numbers when comitting Jupyter notebooks. There +painful when committing. Some people have thus developed specific git +hooks to ignore these numbers when committing Jupyter notebooks. There is a long an interesting discussion about various options on StackOverflow.

-Last but not least, remembter that Jupyter notebooks are only a small +Last but not least, remember that Jupyter notebooks are only a small part of the picture and that Jupyter is now part of a bigger project: JupyterLab, which allows you to mix various components (including notebooks) in your browser. A specific JupyterLab git plugin has been -- 2.18.1