Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mooc-rr-ressources
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Learning Lab
mooc-rr-ressources
Commits
e431e0d6
Commit
e431e0d6
authored
Jul 19, 2018
by
Arnaud Legrand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Jupyter resources completed
parent
b8db2e1f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
57 additions
and
59 deletions
+57
-59
jupyter.html
module2/ressources/jupyter.html
+51
-52
jupyter.org
module2/ressources/jupyter.org
+6
-7
No files found.
module2/ressources/jupyter.html
View file @
e431e0d6
...
...
@@ -4,34 +4,34 @@
<h2>
Table of Contents
</h2>
<div
id=
"text-table-of-contents"
>
<ul
style=
"margin:0 0;"
>
<li
style=
"margin-bottom:0;"
><a
href=
"#org
975cdde
"
>
Additional Jupyter resources or tricks
</a>
<li
style=
"margin-bottom:0;"
><a
href=
"#org
8ad7af5
"
>
Additional Jupyter resources or tricks
</a>
<ul
style=
"margin:0 0;"
>
<li
style=
"margin-bottom:0;"
><a
href=
"#org2
7d1582
"
>
Tips and tricks
</a></li>
<li
style=
"margin-bottom:0;"
><a
href=
"#org
4f5f0e8
"
>
Running R and Python in the same notebook
</a></li>
<li
style=
"margin-bottom:0;"
><a
href=
"#org
6e2f783
"
>
Exporting a notebook
</a></li>
<li
style=
"margin-bottom:0;"
><a
href=
"#org2
2d89f4
"
>
Tips and tricks
</a></li>
<li
style=
"margin-bottom:0;"
><a
href=
"#org
0420686
"
>
Running R and Python in the same notebook
</a></li>
<li
style=
"margin-bottom:0;"
><a
href=
"#org
468b24f
"
>
Exporting a notebook
</a></li>
</ul>
</li>
<li
style=
"margin-bottom:0;"
><a
href=
"#org
75409e5
"
>
Installing Jupyter on your own machine
</a>
<li
style=
"margin-bottom:0;"
><a
href=
"#org
2c7ad73
"
>
Installing Jupyter on your own machine
</a>
<ul
style=
"margin:0 0;"
>
<li
style=
"margin-bottom:0;"
><a
href=
"#org
73474e0
"
>
Installing jupyter
</a></li>
<li
style=
"margin-bottom:0;"
><a
href=
"#org
5dcb2d4
"
>
Using R
</a></li>
<li
style=
"margin-bottom:0;"
><a
href=
"#org
919a045
"
>
Exporting your notebooks with latex
</a></li>
<li
style=
"margin-bottom:0;"
><a
href=
"#org
3bdebf
b"
>
Interacting with gitlab
</a></li>
<li
style=
"margin-bottom:0;"
><a
href=
"#org
ee218a0
"
>
Interesting extensions to improve notebook readability
</a></li>
<li
style=
"margin-bottom:0;"
><a
href=
"#org
b4b3874
"
>
Installing jupyter
</a></li>
<li
style=
"margin-bottom:0;"
><a
href=
"#org
f5ae3b1
"
>
Using R
</a></li>
<li
style=
"margin-bottom:0;"
><a
href=
"#org
f90bf40
"
>
Exporting your notebooks with latex
</a></li>
<li
style=
"margin-bottom:0;"
><a
href=
"#org
77f31c
b"
>
Interacting with gitlab
</a></li>
<li
style=
"margin-bottom:0;"
><a
href=
"#org
0c2d49c
"
>
Interesting extensions to improve notebook readability
</a></li>
</ul>
</li>
<li
style=
"margin-bottom:0;"
><a
href=
"#org
4ee7491
"
>
Installing JupyterHub
   
<span
class=
"tag"
><span
class=
"Benoit"
>
Benoit
</span></span></a></li>
<li
style=
"margin-bottom:0;"
><a
href=
"#org
acebcf9
"
>
Installing JupyterHub
   
<span
class=
"tag"
><span
class=
"Benoit"
>
Benoit
</span></span></a></li>
</ul>
</div>
</div>
<div
id=
"outline-container-org
975cdde
"
class=
"outline-2"
>
<h2
id=
"org
975cdde
"
>
Additional Jupyter resources or tricks
</h2>
<div
class=
"outline-text-2"
id=
"text-org
975cdde
"
>
<div
id=
"outline-container-org
8ad7af5
"
class=
"outline-2"
>
<h2
id=
"org
8ad7af5
"
>
Additional Jupyter resources or tricks
</h2>
<div
class=
"outline-text-2"
id=
"text-org
8ad7af5
"
>
</div>
<div
id=
"outline-container-org2
7d1582
"
class=
"outline-3"
>
<h3
id=
"org2
7d1582
"
>
Tips and tricks
</h3>
<div
class=
"outline-text-3"
id=
"text-org2
7d1582
"
>
<div
id=
"outline-container-org2
2d89f4
"
class=
"outline-3"
>
<h3
id=
"org2
2d89f4
"
>
Tips and tricks
</h3>
<div
class=
"outline-text-3"
id=
"text-org2
2d89f4
"
>
<p>
The following
<a
href=
"https://www.dataquest.io/blog/jupyter-notebook-tips-tricks-shortcuts/"
>
webpage
</a>
lists several Jupyter tricks (in particular, it
illustrates many
<code>
Ipython magic
</code>
commands) that should improve your
...
...
@@ -41,9 +41,9 @@ now).
</p>
</div>
</div>
<div
id=
"outline-container-org
4f5f0e8
"
class=
"outline-3"
>
<h3
id=
"org
4f5f0e8
"
>
Running R and Python in the same notebook
</h3>
<div
class=
"outline-text-3"
id=
"text-org
4f5f0e8
"
>
<div
id=
"outline-container-org
0420686
"
class=
"outline-3"
>
<h3
id=
"org
0420686
"
>
Running R and Python in the same notebook
</h3>
<div
class=
"outline-text-3"
id=
"text-org
0420686
"
>
<p>
The best solution to this is to install rpy2. On my machine, I have
installed the
<code>
python3-rpy2
</code>
debian package with
<code>
apt-get install
</code>
. An
...
...
@@ -74,20 +74,20 @@ summary(cars)
</pre>
</div>
<p>
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
<code>
df
</code>
is a pandas dataframe
)
:
</p>
<div
class=
"org-src-container"
>
<pre
style=
"padding-left: 30px; background-color: #f6f8fa;"
class=
"src src-python"
>
%%R -i df
plot(
(
df)
plot(df)
</pre>
</div></li>
</ol>
</div>
</div>
<div
id=
"outline-container-org
6e2f783
"
class=
"outline-3"
>
<h3
id=
"org
6e2f783
"
>
Exporting a notebook
</h3>
<div
class=
"outline-text-3"
id=
"text-org
6e2f783
"
>
<div
id=
"outline-container-org
468b24f
"
class=
"outline-3"
>
<h3
id=
"org
468b24f
"
>
Exporting a notebook
</h3>
<div
class=
"outline-text-3"
id=
"text-org
468b24f
"
>
<p>
Obviously, you can convert to html or pdf using the using the
<code>
File
>
Download as
>
HTML
</code>
(or
<code>
PDF
</code>
) menu option. This can also be done from
...
...
@@ -114,13 +114,13 @@ taste.
</div>
</div>
</div>
<div
id=
"outline-container-org
75409e5
"
class=
"outline-2"
>
<h2
id=
"org
75409e5
"
>
Installing Jupyter on your own machine
</h2>
<div
class=
"outline-text-2"
id=
"text-org
75409e5
"
>
<div
id=
"outline-container-org
2c7ad73
"
class=
"outline-2"
>
<h2
id=
"org
2c7ad73
"
>
Installing Jupyter on your own machine
</h2>
<div
class=
"outline-text-2"
id=
"text-org
2c7ad73
"
>
</div>
<div
id=
"outline-container-org
73474e0
"
class=
"outline-3"
>
<h3
id=
"org
73474e0
"
>
Installing jupyter
</h3>
<div
class=
"outline-text-3"
id=
"text-org
73474e0
"
>
<div
id=
"outline-container-org
b4b3874
"
class=
"outline-3"
>
<h3
id=
"org
b4b3874
"
>
Installing jupyter
</h3>
<div
class=
"outline-text-3"
id=
"text-org
b4b3874
"
>
<p>
Here is what you should install:
</p>
...
...
@@ -151,16 +151,15 @@ The ipython notebook can then be run with the following command:
</div>
</div>
</div>
<div
id=
"outline-container-org
5dcb2d4
"
class=
"outline-3"
>
<h3
id=
"org
5dcb2d4
"
>
Using R
</h3>
<div
class=
"outline-text-3"
id=
"text-org
5dcb2d4
"
>
<div
id=
"outline-container-org
f5ae3b1
"
class=
"outline-3"
>
<h3
id=
"org
f5ae3b1
"
>
Using R
</h3>
<div
class=
"outline-text-3"
id=
"text-org
f5ae3b1
"
>
<p>
If you also want to have the R kernel in jupyter, follow
<a
href=
"https://github.com/IRkernel/IRkernel#installation"
>
these
instructions
</a>
.
If you want to use the R kernel in jupyter, follow
<a
href=
"https://github.com/IRkernel/IRkernel#installation"
>
these instructions
</a>
.
</p>
<p>
Alternatively, you can install
<code>
rpy2
</code>
(see the
<a
href=
"#org
4f5f0e8
"
>
Running R and Python in
Alternatively, you can install
<code>
rpy2
</code>
(see the
<a
href=
"#org
0420686
"
>
Running R and Python in
the same notebook
</a>
section).
</p>
<div
class=
"org-src-container"
>
...
...
@@ -169,12 +168,12 @@ the same notebook</a> section).
</div>
</div>
</div>
<div
id=
"outline-container-org
919a045
"
class=
"outline-3"
>
<h3
id=
"org
919a045
"
>
Exporting your notebooks with latex
</h3>
<div
class=
"outline-text-3"
id=
"text-org
919a045
"
>
<div
id=
"outline-container-org
f90bf40
"
class=
"outline-3"
>
<h3
id=
"org
f90bf40
"
>
Exporting your notebooks with latex
</h3>
<div
class=
"outline-text-3"
id=
"text-org
f90bf40
"
>
<p>
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:
</p>
<div
class=
"org-src-container"
>
<pre
style=
"padding-left: 30px; background-color: #f6f8fa;"
class=
"src src-shell"
>
sudo apt-get install wkhtmltopdf
...
...
@@ -183,9 +182,9 @@ sudo apt-get install texlive-xetex
</div>
</div>
</div>
<div
id=
"outline-container-org
3bdebf
b"
class=
"outline-3"
>
<h3
id=
"org
3bdebf
b"
>
Interacting with gitlab
</h3>
<div
class=
"outline-text-3"
id=
"text-org
3bdebf
b"
>
<div
id=
"outline-container-org
77f31c
b"
class=
"outline-3"
>
<h3
id=
"org
77f31c
b"
>
Interacting with gitlab
</h3>
<div
class=
"outline-text-3"
id=
"text-org
77f31c
b"
>
<p>
Here is our
<a
href=
"https://github.com/brospars/nb-git"
>
jupyter extension that allows to git push/pull from the
notebooks
</a>
:
...
...
@@ -197,9 +196,9 @@ jupyter nbextension enable nb-git
</div>
</div>
</div>
<div
id=
"outline-container-org
ee218a0
"
class=
"outline-3"
>
<h3
id=
"org
ee218a0
"
>
Interesting extensions to improve notebook readability
</h3>
<div
class=
"outline-text-3"
id=
"text-org
ee218a0
"
>
<div
id=
"outline-container-org
0c2d49c
"
class=
"outline-3"
>
<h3
id=
"org
0c2d49c
"
>
Interesting extensions to improve notebook readability
</h3>
<div
class=
"outline-text-3"
id=
"text-org
0c2d49c
"
>
<p>
Here are two interesting extensions that can improve readability:
</p>
...
...
@@ -226,9 +225,9 @@ jupyter-serverextension enable --py hide_code
</div>
</div>
</div>
<div
id=
"outline-container-org
4ee7491
"
class=
"outline-2"
>
<h2
id=
"org
4ee7491
"
>
Installing JupyterHub
   
<span
class=
"tag"
><span
class=
"Benoit"
>
Benoit
</span></span></h2>
<div
class=
"outline-text-2"
id=
"text-org
4ee7491
"
>
<div
id=
"outline-container-org
acebcf9
"
class=
"outline-2"
>
<h2
id=
"org
acebcf9
"
>
Installing JupyterHub
   
<span
class=
"tag"
><span
class=
"Benoit"
>
Benoit
</span></span></h2>
<div
class=
"outline-text-2"
id=
"text-org
acebcf9
"
>
<blockquote>
<p>
Benoit may give a few hints on this.
...
...
module2/ressources/jupyter.org
View file @
e431e0d6
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment