From e431e0d6ce208a8b92f07d4822af83fc1a7f387e Mon Sep 17 00:00:00 2001 From: Arnaud Legrand Date: Thu, 19 Jul 2018 22:50:27 +0200 Subject: [PATCH] Jupyter resources completed --- module2/ressources/jupyter.html | 103 ++++++++++++++++---------------- module2/ressources/jupyter.org | 13 ++-- 2 files changed, 57 insertions(+), 59 deletions(-) diff --git a/module2/ressources/jupyter.html b/module2/ressources/jupyter.html index 252e1db..b47162e 100644 --- a/module2/ressources/jupyter.html +++ b/module2/ressources/jupyter.html @@ -4,34 +4,34 @@

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 @@ -41,9 +41,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. An @@ -74,20 +74,20 @@ summary(cars)

-Python objects can then even be passed to R as follows (assuming df -is a pandas dataframe: +Python objects can then even be passed to R as follows (assuming df +is a pandas dataframe):

%%R -i df
-plot((df)
+plot(df)
 
-
-

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 @@ -114,13 +114,13 @@ taste.

-
-

Installing Jupyter on your own machine

-
+
+

Installing Jupyter on your own machine

+
-
-

Installing jupyter

-
+
+

Installing jupyter

+

Here is what you should install:

@@ -151,16 +151,15 @@ The ipython notebook can then be run with the following command:
-
-

Using R

-
+
+

Using R

+

-If you also want to have the R kernel in jupyter, follow these -instructions. +If you want to use the R kernel in jupyter, follow these instructions.

-Alternatively, you can install rpy2 (see the Running R and Python in +Alternatively, you can install rpy2 (see the Running R and Python in the same notebook section).

@@ -169,12 +168,12 @@ the same notebook section).
-
-

Exporting your notebooks with latex

-
+
+

Exporting your notebooks with latex

+

-Here is what I had to install to make sure the notebook export via -latex works: +Here is what I had to install on my recent debian machine to make sure +the notebook export via latex works:

sudo apt-get install wkhtmltopdf
@@ -183,9 +182,9 @@ sudo apt-get install texlive-xetex
 
-
-

Interacting with gitlab

-
+
+

Interacting with gitlab

+

Here is our jupyter extension that allows to git push/pull from the notebooks: @@ -197,9 +196,9 @@ jupyter nbextension enable nb-git

-
-

Interesting extensions to improve notebook readability

-
+
+

Interesting extensions to improve notebook readability

+

Here are two interesting extensions that can improve readability:

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

Installing JupyterHub   Benoit

-
+
+

Installing JupyterHub   Benoit

+

Benoit may give a few hints on this. diff --git a/module2/ressources/jupyter.org b/module2/ressources/jupyter.org index c4b807b..040e86c 100644 --- a/module2/ressources/jupyter.org +++ b/module2/ressources/jupyter.org @@ -31,11 +31,11 @@ Then you'll be able to use both languages in the same notebook by: %R summary(cars) #+end_src - Python objects can then even be passed to R as follows (assuming df - is a pandas dataframe: + Python objects can then even be passed to R as follows (assuming =df= + is a pandas dataframe): #+begin_src python :results output :exports both %%R -i df - plot((df) + plot(df) #+end_src ** Exporting a notebook Obviously, you can convert to html or pdf using the using the =File > @@ -74,8 +74,7 @@ The ipython notebook can then be run with the following command: jupyter-notebook #+end_src ** Using R -If you also want to have the R kernel in jupyter, follow [[https://github.com/IRkernel/IRkernel#installation][these -instructions]]. +If you want to use the R kernel in jupyter, follow [[https://github.com/IRkernel/IRkernel#installation][these instructions]]. Alternatively, you can install =rpy2= (see the [[*Running R and Python in the same notebook][Running R and Python in the same notebook]] section). @@ -83,8 +82,8 @@ the same notebook]] section). sudo apt-get python3-rpy2 #+end_src ** Exporting your notebooks with latex -Here is what I had to install to make sure the notebook export via -latex works: +Here is what I had to install on my recent debian machine to make sure +the notebook export via latex works: #+begin_src shell :results output :exports both sudo apt-get install wkhtmltopdf sudo apt-get install texlive-xetex -- 2.18.1