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
8e60f707
Commit
8e60f707
authored
Sep 05, 2018
by
Arnaud Legrand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Damn!
parent
1d9b100e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
9 deletions
+12
-9
jupyter.org
module2/ressources/jupyter.org
+12
-9
No files found.
module2/ressources/jupyter.org
View file @
8e60f707
...
@@ -19,8 +19,8 @@ installed the =python3-rpy2= debian package with =apt-get install=. E.g.,
...
@@ -19,8 +19,8 @@ installed the =python3-rpy2= debian package with =apt-get install=. E.g.,
#+begin_src shell :results output :exports both
#+begin_src shell :results output :exports both
sudo apt-get install python3-rpy2 python3-tzlocal
sudo apt-get install python3-rpy2 python3-tzlocal
#+end_src
#+end_src
An other (not really recomm
anded) alternative consists in going
An other (not really recomm
ended if the first one is available)
through the python package manager with
alternative consists in going
through the python package manager with
#+begin_src python :results output :exports both
#+begin_src python :results output :exports both
pip3 install rpy2
pip3 install rpy2
#+end_src
#+end_src
...
@@ -31,7 +31,7 @@ Then you'll be able to use both languages in the same notebook by:
...
@@ -31,7 +31,7 @@ Then you'll be able to use both languages in the same notebook by:
#+end_src
#+end_src
2. Using the =%R= Ipython magic:
2. Using the =%R= Ipython magic:
#+begin_src python :results output :exports both
#+begin_src python :results output :exports both
%R
%
%
R
summary(cars)
summary(cars)
#+end_src
#+end_src
Python objects can then even be passed to R as follows (assuming =df=
Python objects can then even be passed to R as follows (assuming =df=
...
@@ -40,6 +40,9 @@ Then you'll be able to use both languages in the same notebook by:
...
@@ -40,6 +40,9 @@ Then you'll be able to use both languages in the same notebook by:
%%R -i df
%%R -i df
plot(df)
plot(df)
#+end_src
#+end_src
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 >
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
Download as > HTML= (or =PDF=) menu option. This can also be done from
...
@@ -49,12 +52,12 @@ the command line with the following command:
...
@@ -49,12 +52,12 @@ the command line with the following command:
ipython3 nbconvert --to pdf Untitled.ipynb
ipython3 nbconvert --to pdf Untitled.ipynb
#+end_src
#+end_src
If you want to use a specific style, then the
nbconvert
exporter
If you want to use a specific style, then the
=nbconvert=
exporter
should be customi
s
ed. This is discussed and demoed [[http://markus-beuckelmann.de/blog/customizing-nbconvert-pdf.html][here]]. We encourage
should be customi
z
ed. This is discussed and demoed [[http://markus-beuckelmann.de/blog/customizing-nbconvert-pdf.html][here]]. We encourage
you to simply read the [[https://nbconvert.readthedocs.io/en/latest/][doc of nbconvert]].
you to simply read the [[https://nbconvert.readthedocs.io/en/latest/][doc of nbconvert]].
Instead of going directly through LaTeX and playing too much with the
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 [[https://pandoc.org/][pandoc]]. Both approaches work, it's rather a matter of
and playing with [[https://pandoc.org/][pandoc]]. Both approaches work, it's rather a matter of
taste.
taste.
* Installing Jupyter on your own machine
* Installing Jupyter on your own machine
...
@@ -122,12 +125,12 @@ This being said, you may have noticed that Jupyter keeps a perfect
...
@@ -122,12 +125,12 @@ 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
track of the sequence in which cells have been run by updating the
"output index". This is a very good property from the reproducibility
"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
point of view but depending on your usage, you may find it a bit
painful when commit
ing. Some people have thus develop
ped [[https://gist.github.com/pbugnion/ea2797393033b54674af][specific git
painful when commit
ting. Some people have thus develo
ped [[https://gist.github.com/pbugnion/ea2797393033b54674af][specific git
hooks]] to ignore these numbers when comitting Jupyter notebooks. There
hooks]] to ignore these numbers when com
m
itting Jupyter notebooks. There
is a long an interesting discussion about various options on
is a long an interesting discussion about various options on
[[https://stackoverflow.com/questions/18734739/using-ipython-notebooks-under-version-control][StackOverflow]].
[[https://stackoverflow.com/questions/18734739/using-ipython-notebooks-under-version-control][StackOverflow]].
Last but not least, rememb
t
er 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:
part of the picture and that Jupyter is now part of a bigger project:
[[https://blog.jupyter.org/jupyterlab-is-ready-for-users-5a6f039b8906][JupyterLab]], which allows you to mix various components (including
[[https://blog.jupyter.org/jupyterlab-is-ready-for-users-5a6f039b8906][JupyterLab]], which allows you to mix various components (including
notebooks) in your browser. A specific [[https://github.com/jupyterlab/jupyterlab-git][JupyterLab git plugin]] has been
notebooks) in your browser. A specific [[https://github.com/jupyterlab/jupyterlab-git][JupyterLab git plugin]] has been
...
...
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