|
6 | 6 | "source": [
|
7 | 7 | "# Exercise 1 notebook\n",
|
8 | 8 | "\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", |
10 | 10 | "\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", |
12 | 14 | "\n",
|
13 | 15 | "$$f(x) = a.x^2+b.x+c$$\n",
|
14 | 16 | "\n",
|
15 | 17 | "$$x_\\pm = \\frac{-b \\pm \\sqrt(b^2-4ac)}{2a}$$\n",
|
16 | 18 | "\n",
|
17 |
| - "Tribple backticks with llanguage\n", |
| 19 | + "Here is an example with triple backticks and language-specific syntax highlighting:\n", |
18 | 20 | "\n",
|
19 | 21 | "```python\n",
|
20 | 22 | "# I can write some code:\n",
|
21 | 23 | "from IPython.display import Math\n",
|
22 | 24 | "Math('\\Delta = b^2-4ac')\n",
|
23 | 25 | "```\n",
|
24 | 26 | "\n",
|
25 |
| - "Indented 4 spaces:\n", |
| 27 | + "And an example with indented 4 spaces:\n", |
26 | 28 | "\n",
|
27 | 29 | " # I can write some code:\n",
|
28 | 30 | " from IPython.display import Math\n",
|
29 | 31 | " Math('\\Delta = b^2-4ac')\n",
|
30 | 32 | "\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...)" |
33 | 34 | ]
|
34 | 35 | },
|
35 | 36 | {
|
|
60 | 61 | "cell_type": "markdown",
|
61 | 62 | "metadata": {},
|
62 | 63 | "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:" |
64 | 65 | ]
|
65 | 66 | },
|
66 | 67 | {
|
|
84 | 85 | "cell_type": "markdown",
|
85 | 86 | "metadata": {},
|
86 | 87 | "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." |
88 | 89 | ]
|
89 | 90 | },
|
90 | 91 | {
|
|
118 | 119 | }
|
119 | 120 | ],
|
120 | 121 | "source": [
|
121 |
| - "# crl-enter to iter through this.\n", |
| 122 | + "# Use Ctrl-Enter to iterate through values of fib\n", |
122 | 123 | "next(fib)"
|
123 | 124 | ]
|
124 | 125 | },
|
125 | 126 | {
|
126 | 127 | "cell_type": "markdown",
|
127 | 128 | "metadata": {},
|
128 | 129 | "source": [
|
129 |
| - "## kernel's related functionalities." |
| 130 | + "Practice tab completion using the following example:" |
130 | 131 | ]
|
131 | 132 | },
|
132 | 133 | {
|
133 | 134 | "cell_type": "code",
|
134 |
| - "execution_count": 5, |
| 135 | + "execution_count": 1, |
135 | 136 | "metadata": {},
|
136 | 137 | "outputs": [],
|
137 | 138 | "source": [
|
|
215 | 216 | }
|
216 | 217 | ],
|
217 | 218 | "source": [
|
218 |
| - "# tab\n", |
| 219 | + "# tab to DataFrame\n", |
219 | 220 | "pd.D"
|
220 | 221 | ]
|
221 | 222 | },
|
|
225 | 226 | "metadata": {},
|
226 | 227 | "outputs": [],
|
227 | 228 | "source": [
|
228 |
| - "#Shift-tab\n", |
| 229 | + "# Shift-Tab to see DataFrame parameters\n", |
229 | 230 | "pd.DataFrame("
|
230 | 231 | ]
|
231 | 232 | },
|
|
265 | 266 | },
|
266 | 267 | {
|
267 | 268 | "cell_type": "code",
|
268 |
| - "execution_count": 54, |
| 269 | + "execution_count": 2, |
269 | 270 | "metadata": {},
|
270 | 271 | "outputs": [],
|
271 | 272 | "source": [
|
| 273 | + "## Use multiple cursors to uncomment the following\n", |
272 | 274 | "#import IPython\n",
|
273 | 275 | "#ip = get_ipython()\n",
|
274 | 276 | "#ip.Completer.use_jedi = False"
|
|
370 | 372 | "df.head()"
|
371 | 373 | ]
|
372 | 374 | },
|
| 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 | + }, |
373 | 382 | {
|
374 | 383 | "cell_type": "code",
|
375 |
| - "execution_count": 14, |
| 384 | + "execution_count": 4, |
376 | 385 | "metadata": {},
|
377 | 386 | "outputs": [],
|
378 | 387 | "source": [
|
|
413 | 422 | },
|
414 | 423 | {
|
415 | 424 | "cell_type": "code",
|
416 |
| - "execution_count": 17, |
| 425 | + "execution_count": 6, |
417 | 426 | "metadata": {},
|
418 | 427 | "outputs": [
|
419 | 428 | {
|
|
928 | 937 | " print(i,\":\",i**2)"
|
929 | 938 | ]
|
930 | 939 | },
|
| 940 | + { |
| 941 | + "cell_type": "markdown", |
| 942 | + "metadata": {}, |
| 943 | + "source": [ |
| 944 | + "You can even launch a browser pop-up through IPython:" |
| 945 | + ] |
| 946 | + }, |
931 | 947 | {
|
932 | 948 | "cell_type": "code",
|
933 | 949 | "execution_count": 19,
|
|
953 | 969 | ]
|
954 | 970 | },
|
955 | 971 | {
|
956 |
| - "cell_type": "code", |
957 |
| - "execution_count": null, |
| 972 | + "cell_type": "markdown", |
958 | 973 | "metadata": {},
|
959 |
| - "outputs": [], |
960 |
| - "source": [] |
| 974 | + "source": [ |
| 975 | + "The end. 🎉" |
| 976 | + ] |
961 | 977 | }
|
962 | 978 | ],
|
963 | 979 | "metadata": {
|
|
0 commit comments