Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Programming course
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
courses
Programming course
Commits
ce24c966
Commit
ce24c966
authored
10 years ago
by
Vermaat
Browse files
Options
Downloads
Patches
Plain Diff
Typographic fixes
parent
2ab071ef
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
05 - IPython Notebook.ipynb
+46
-46
46 additions, 46 deletions
05 - IPython Notebook.ipynb
06 - Plotting with matplotlib.ipynb
+65
-72
65 additions, 72 deletions
06 - Plotting with matplotlib.ipynb
with
111 additions
and
118 deletions
05 - IPython Notebook.ipynb
+
46
−
46
View file @
ce24c966
{
"metadata": {
"name": "",
"signature": "sha256:
ffac64912e6dd086a01e7335bc70811bb3d120474fe85a1a87e60f80994db347
"
"signature": "sha256:
39c27ff67b9be7533af308aa219e7b09f8e4e13d0ac066d82e3063adac5e0036
"
},
"nbformat": 3,
"nbformat_minor": 0,
...
...
@@ -111,7 +111,7 @@
" \n",
" \n",
"- Online repository\n",
" - Git
h
ub"
" - Git
H
ub"
]
},
{
...
...
@@ -155,7 +155,7 @@
"level": 4,
"metadata": {},
"source": [
"Lots of reasons to
p
ython!
\n
"
"Lots of reasons to
P
ython!"
]
},
{
...
...
@@ -163,7 +163,7 @@
"level": 4,
"metadata": {},
"source": [
"How to
p
ython?"
"How to
P
ython?"
]
},
{
...
...
@@ -171,7 +171,7 @@
"level": 1,
"metadata": {},
"source": [
"The
p
ython interpreter"
"The
P
ython interpreter"
]
},
{
...
...
@@ -181,14 +181,14 @@
"- Standard way of running code\n",
"- Reads and runs the code in a file\n",
"\n",
"$ python my-program.py"
"
`
$ python my-program.py
`
"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"- Alternatively, start the interpreter interactively by simply typing python\n",
"- Alternatively, start the interpreter interactively by simply typing
`
python
`
\n",
"- Not very convenient due to a number of limitations\n"
]
},
...
...
@@ -196,7 +196,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"$ python"
"
`
$ python
`
"
]
},
{
...
...
@@ -225,7 +225,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"$ ipython"
"
`
$ ipython
`
"
]
},
{
...
...
@@ -258,7 +258,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"- Started by typing 'ipython notebook' in the directory where you want to store notebooks\n",
"- Started by typing '
`
ipython notebook
`
' in the directory where you want to store notebooks\n",
"- Opens a new browser window with an index page where existing notebooks are shown\n",
"- New notebooks can be created in that same directory"
]
...
...
@@ -267,7 +267,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"$ ipython notebook"
"
`
$ ipython notebook
`
"
]
},
{
...
...
@@ -371,12 +371,12 @@
"- Install locally\n",
" - See instructions in this course\n",
" - Linux, Windows\n",
" - Type 'ipython notebook'\n",
" - Type '
`
ipython notebook
`
'\n",
" \n",
" \n",
"- Remotely, Shark cluster LUMC\n",
" - Connect to shark\n",
" - Type 'notebook' and click the given URL"
" - Type '
`
notebook
`
' and click the given URL"
]
},
{
...
...
@@ -408,8 +408,8 @@
"metadata": {},
"source": [
"- Edit mode\n",
" - Hit ENTER or click the edit area to change to edit mode\n",
" - Indicated with a <font color='green'>green</font> cell border\n",
" - Hit
**
ENTER
**
or click the edit area to change to edit mode\n",
" - Indicated with a <font color='green'>
**
green
**
</font> cell border\n",
" - Edit your cell as if a normal text editor\n",
" \n",
"\n",
...
...
@@ -422,8 +422,8 @@
"metadata": {},
"source": [
"- Command mode\n",
" - Hit ESCAPE to change into command mode\n",
" - Indicated with a <font color='grey'>grey</font> cell border\n",
" - Hit
**
ESCAPE
**
to change into command mode\n",
" - Indicated with a <font color='grey'>
**
grey
**
</font> cell border\n",
" - Edit the notebook as a whole\n",
"\n",
"Note: Different shortcuts apply in both modes!\n",
...
...
@@ -523,7 +523,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Press '
h
' to show the help."
"Press '
**h**
' to show the help."
]
},
{
...
...
@@ -539,7 +539,7 @@
"metadata": {},
"source": [
"- The notebook automatically saves\n",
"- You can manually click the 'save' icon or press CTRL+s"
"- You can manually click the 'save' icon or press
**
CTRL+s
**
"
]
},
{
...
...
@@ -609,7 +609,7 @@
"metadata": {},
"source": [
"- Select the type from the dropdown box in the toolbar\n",
"- In command mode only: Press '
y
' for code or '
m
' for markdown"
"- In command mode only: Press '
**y**
' for code or '
**m**
' for markdown"
]
},
{
...
...
@@ -656,7 +656,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Run a code cell by pressing the play button or
shift+enter
"
"Run a code cell by pressing the play button or
**SHIFT+ENTER**.
"
]
},
{
...
...
@@ -813,7 +813,7 @@
"level": 4,
"metadata": {},
"source": [
"Autocompletion works
also
by pressing TAB:"
"Autocompletion works by pressing TAB:"
]
},
{
...
...
@@ -870,7 +870,7 @@
"level": 1,
"metadata": {},
"source": [
"\u00a7 Exercise
: My first Notebook (1)"
"\u00a7 Exercise: My first Notebook (1)"
]
},
{
...
...
@@ -878,17 +878,17 @@
"metadata": {},
"source": [
"Start a Notebook session.\n",
" - $ ipython notebook\n",
" -
`
$ ipython notebook
`
\n",
"\n",
"This opens a webbrowser and shows existing notebooks.\n",
" - Create a new notebook by clicking the 'New notebook' button.\n",
" - Create a new notebook by clicking the '
*
New notebook
*
' button.\n",
"\n",
"A new tab will open with a fresh notebook. Rename your notebook to something useful\n",
" - Click on the current name (Untitled1) and edit this\n",
" - Click on the current name (
*
Untitled1
*
) and edit this\n",
"\n",
"Add the code shown below to some **_code_** cells\n",
" - Add cells by pressing the '
+
' button or ALT+ENTER\n",
" - Remember the keyboard shortcuts or the help function ('
h
')\n",
" - Add cells by pressing the '
**+**
' button or
**
ALT+ENTER
**
\n",
" - Remember the keyboard shortcuts or the help function ('
**h**
')\n",
"\n",
"\n",
"Notice the last cell produced output! We will continue to develop this notebook later this session."
...
...
@@ -945,7 +945,7 @@
"- When a cell is run it can generate output\n",
"- This is shown below the cell in the output area\n",
"- Output is asynchronous\n",
"- Outputs are objects and the last one is available under the variable '
_
'\n",
"- Outputs are objects and the last one is available under the variable '
`_`
'\n",
" "
]
},
...
...
@@ -954,7 +954,7 @@
"level": 4,
"metadata": {},
"source": [
"Example: Show some output and use it in
to
another function"
"Example: Show some output and use it in another function"
]
},
{
...
...
@@ -1098,9 +1098,9 @@
"source": [
"To create a markdown cell:\n",
"- First focus on the cell you want to format\n",
"- Then select 'Markdown' the dropdown box in the toolbar or press '
m
' in command mode\n",
"- Then select '
*
Markdown
*
' the dropdown box in the toolbar or press '
**m**
' in command mode\n",
"- Note that you need to run a markdown cell to show the result\n",
" - Click 'play' or SHIFT+ENTER"
" - Click '
*
play
*
' or
**
SHIFT+ENTER
**
"
]
},
{
...
...
@@ -1332,13 +1332,13 @@
],
"metadata": {},
"output_type": "pyout",
"prompt_number":
1
,
"prompt_number":
4
,
"text": [
"<IPython.lib.display.YouTubeVideo at 0x
23c289
0>"
"<IPython.lib.display.YouTubeVideo at 0x
1fed5d
0>"
]
}
],
"prompt_number":
1
"prompt_number":
4
},
{
"cell_type": "heading",
...
...
@@ -1383,7 +1383,7 @@
"level": 1,
"metadata": {},
"source": [
"\u00a7 Exercise
: My first Notebook (2)"
"\u00a7 Exercise: My first Notebook (2)"
]
},
{
...
...
@@ -1392,11 +1392,11 @@
"source": [
"Let's add some markdown cells to the notebook you created earlier:\n",
" - Select the top code cell\n",
" - Press ESC to go into command mode\n",
" - Press '
a
', this will add a cell above the selected cell\n",
" - Press
**
ESC
**
to go into command mode\n",
" - Press '
**a**
', this will add a cell above the selected cell\n",
" - Notice the focus is on the new cell\n",
" - Now press '
m
' to set the celltype to 'Markdown'\n",
" - Press ENTER and add some code (see below for example)\n",
" - Now press '
**m**
' to set the celltype to 'Markdown'\n",
" - Press
**
ENTER
**
and add some code (see below for example)\n",
" - Run the cell and see if it worked\n"
]
},
...
...
@@ -1427,7 +1427,7 @@
"source": [
"Now, try to add more python code to the notebook:\n",
" - Make sure to set the cell type to code\n",
" - Add the 'reverse' function to your notebook as shown below"
" - Add the '
`
reverse
`
' function to your notebook as shown below"
]
},
{
...
...
@@ -1447,7 +1447,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Try using both the 'reverse' and 'translate' function."
"Try using both the '
`
reverse
`
' and '
`
translate
`
' function."
]
},
{
...
...
@@ -1495,7 +1495,7 @@
"level": 1,
"metadata": {},
"source": [
"\u00a7 Exercise
: My first Notebook (3)\n",
"\u00a7 Exercise: My first Notebook (3)\n",
" "
]
},
...
...
@@ -1529,7 +1529,7 @@
"metadata": {},
"source": [
" - Think of a function which can test if a sequence is palindromic\n",
" - Use the functions 'complement' and 'reverse'\n",
" - Use the functions '
`
complement
`
' and '
`
reverse
`
'\n",
" - Nicely formatted mardown cell(s) explaining the notebook\n",
" - Add links as references like the one above\n",
"\n",
...
...
@@ -1645,7 +1645,7 @@
"output_type": "pyout",
"prompt_number": 2,
"text": [
"<IPython.core.display.HTML at 0x1
d0271
0>"
"<IPython.core.display.HTML at 0x1
fed69
0>"
]
}
],
...
...
@@ -1682,7 +1682,7 @@
"output_type": "pyout",
"prompt_number": 3,
"text": [
"<IPython.core.display.HTML at 0x1
d02a9
0>"
"<IPython.core.display.HTML at 0x1
fed91
0>"
]
}
],
...
...
This diff is collapsed.
Click to expand it.
06 - Plotting with matplotlib.ipynb
+
65
−
72
View file @
ce24c966
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment