Skip to content

Commit cc3d5b2

Browse files
committed
Grammar and flow on Exercise1
* Edits based on my experience at PyCon
1 parent f1c8afb commit cc3d5b2

File tree

2 files changed

+39
-22
lines changed

2 files changed

+39
-22
lines changed

4-JupyterLab-UI/Exercise-1-solutions.ipynb

Lines changed: 36 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,30 +6,31 @@
66
"source": [
77
"# Exercise 1 notebook\n",
88
"\n",
9-
"This has just solution, or if you just want tosee the finisehed homework.\n",
9+
"This notebook contains solutions to the homework in this same folder (\"Exercise1.md\").\n",
1010
"\n",
11-
"This is a markdown cell with **bold** _italic_ inline $math$, and formulas:\n",
11+
"## Notebook operations and advanced operations\n",
12+
"\n",
13+
"This is a Markdown cell with **bold**, _italic_, in-line $math$, and formulas:\n",
1214
"\n",
1315
"$$f(x) = a.x^2+b.x+c$$\n",
1416
"\n",
1517
"$$x_\\pm = \\frac{-b \\pm \\sqrt(b^2-4ac)}{2a}$$\n",
1618
"\n",
17-
"Tribple backticks with llanguage\n",
19+
"Here is an example with triple backticks and language-specific syntax highlighting:\n",
1820
"\n",
1921
"```python\n",
2022
"# I can write some code:\n",
2123
"from IPython.display import Math\n",
2224
"Math('\\Delta = b^2-4ac')\n",
2325
"```\n",
2426
"\n",
25-
"Indented 4 spaces:\n",
27+
"And an example with indented 4 spaces:\n",
2628
"\n",
2729
" # I can write some code:\n",
2830
" from IPython.display import Math\n",
2931
" Math('\\Delta = b^2-4ac')\n",
3032
"\n",
31-
"\n",
32-
"Try to get a feel of the editor (select and press TAB...)"
33+
"Keep getting the feel of the editor (select and press TAB...)"
3334
]
3435
},
3536
{
@@ -60,7 +61,7 @@
6061
"cell_type": "markdown",
6162
"metadata": {},
6263
"source": [
63-
"Let's carry on with the exercise. To be efficient we'll lear to use the keyboard shortcuts. "
64+
"Continuing on with the exercise remembering to use the keyboard shortcuts to be efficient. Use `Shift-Enter` to execute the following command:"
6465
]
6566
},
6667
{
@@ -84,7 +85,7 @@
8485
"cell_type": "markdown",
8586
"metadata": {},
8687
"source": [
87-
"You will notice that `Ctrl-Enter` execute a cell in place (and keep it selected), while `Shift-Enter` execute and select next. Finally, `Alt-Enter` execute and insert below."
88+
"There are multiple options to run a cell. `Ctrl-Enter` execute a cell in place (and keeps it selected), while `Shift-Enter` execute and select next. Finally, `Alt-Enter` execute and insert below."
8889
]
8990
},
9091
{
@@ -118,20 +119,20 @@
118119
}
119120
],
120121
"source": [
121-
"# crl-enter to iter through this.\n",
122+
"# Use Ctrl-Enter to iterate through values of fib\n",
122123
"next(fib)"
123124
]
124125
},
125126
{
126127
"cell_type": "markdown",
127128
"metadata": {},
128129
"source": [
129-
"## kernel's related functionalities."
130+
"Practice tab completion using the following example:"
130131
]
131132
},
132133
{
133134
"cell_type": "code",
134-
"execution_count": 5,
135+
"execution_count": 1,
135136
"metadata": {},
136137
"outputs": [],
137138
"source": [
@@ -215,7 +216,7 @@
215216
}
216217
],
217218
"source": [
218-
"# tab\n",
219+
"# tab to DataFrame\n",
219220
"pd.D"
220221
]
221222
},
@@ -225,7 +226,7 @@
225226
"metadata": {},
226227
"outputs": [],
227228
"source": [
228-
"#Shift-tab\n",
229+
"# Shift-Tab to see DataFrame parameters\n",
229230
"pd.DataFrame("
230231
]
231232
},
@@ -265,10 +266,11 @@
265266
},
266267
{
267268
"cell_type": "code",
268-
"execution_count": 54,
269+
"execution_count": 2,
269270
"metadata": {},
270271
"outputs": [],
271272
"source": [
273+
"## Use multiple cursors to uncomment the following\n",
272274
"#import IPython\n",
273275
"#ip = get_ipython()\n",
274276
"#ip.Completer.use_jedi = False"
@@ -370,9 +372,16 @@
370372
"df.head()"
371373
]
372374
},
375+
{
376+
"cell_type": "markdown",
377+
"metadata": {},
378+
"source": [
379+
"We can use some % `magic` to run Matplotlib in-line in this notebook."
380+
]
381+
},
373382
{
374383
"cell_type": "code",
375-
"execution_count": 14,
384+
"execution_count": 4,
376385
"metadata": {},
377386
"outputs": [],
378387
"source": [
@@ -413,7 +422,7 @@
413422
},
414423
{
415424
"cell_type": "code",
416-
"execution_count": 17,
425+
"execution_count": 6,
417426
"metadata": {},
418427
"outputs": [
419428
{
@@ -928,6 +937,13 @@
928937
" print(i,\":\",i**2)"
929938
]
930939
},
940+
{
941+
"cell_type": "markdown",
942+
"metadata": {},
943+
"source": [
944+
"You can even launch a browser pop-up through IPython:"
945+
]
946+
},
931947
{
932948
"cell_type": "code",
933949
"execution_count": 19,
@@ -953,11 +969,11 @@
953969
]
954970
},
955971
{
956-
"cell_type": "code",
957-
"execution_count": null,
972+
"cell_type": "markdown",
958973
"metadata": {},
959-
"outputs": [],
960-
"source": []
974+
"source": [
975+
"The end. 🎉"
976+
]
961977
}
962978
],
963979
"metadata": {

4-JupyterLab-UI/Exercise1.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,9 @@ Arrange the notebook and rendered markdown side-by-side. Then arrange them, one
4343

4444
# More advanced notebooks
4545

46-
- Move a cell by dragging
46+
- Move a cell by dragging.
4747
- Use the View menu, or click the blue bar, to collapse and expand an input and an output.
4848
- Use the context menu to enable scrolling in a cell that has lots of output.
49-
- Try “Create new view for output” in the context menu of an output. Modify and execute the cell again to see the mirrored output update (will learn more in section 2)
49+
- Try “Create new view for output” in the context menu of an output. Modify and execute the cell again to see the mirrored output update (will learn more in section 2).
5050
- Learn the various keyboard shortcuts through the menu and the command palette.
51+
- Learn more about kernel functionality (more on that in the exercise solution).

0 commit comments

Comments
 (0)