Skip to content

Commit 5c6fe44

Browse files
committed
Fix some mistakes in slides for session 2
Thanks for the attentive audience pointing out the mistakes!
1 parent 6179113 commit 5c6fe44

File tree

1 file changed

+19
-42
lines changed

1 file changed

+19
-42
lines changed

session2_python_and_programming/slides_session2.ipynb

Lines changed: 19 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"# How to make code beautiful\n",
2323
"### Python beyond basics\n",
2424
"\n",
25-
"<br><br><br><br><br><br>\n",
25+
"<br><br><br><br><br><br><br><br><br><br><br><br>\n",
2626
"<div style=\"font-size:0.8em; color: #555\">2019-04-03 Session 2\n",
2727
"<span style=\"float:right\">Peter Regner</span>\n",
2828
"</div>"
@@ -262,11 +262,7 @@
262262
{
263263
"cell_type": "code",
264264
"execution_count": 3,
265-
"metadata": {
266-
"slideshow": {
267-
"slide_type": "fragment"
268-
}
269-
},
265+
"metadata": {},
270266
"outputs": [],
271267
"source": [
272268
"import antigravity"
@@ -283,7 +279,7 @@
283279
"outputs": [],
284280
"source": [
285281
"import sys\n",
286-
"if 'this' in sys.modules:\n",
282+
"if 'antigravity' in sys.modules:\n",
287283
" del sys.modules['antigravity']"
288284
]
289285
},
@@ -474,18 +470,14 @@
474470
{
475471
"cell_type": "code",
476472
"execution_count": 6,
477-
"metadata": {},
478-
"outputs": [
479-
{
480-
"name": "stdout",
481-
"output_type": "stream",
482-
"text": [
483-
"Way better! Great! 👍\n"
484-
]
473+
"metadata": {
474+
"slideshow": {
475+
"slide_type": "fragment"
485476
}
486-
],
477+
},
478+
"outputs": [],
487479
"source": [
488-
"twitter_search('obama', numtweets=0, retweets=False, unicode=True)"
480+
"ts('obama', False, 20, True)"
489481
]
490482
},
491483
{
@@ -1834,27 +1826,12 @@
18341826
"slide_type": "skip"
18351827
}
18361828
},
1837-
"outputs": [
1838-
{
1839-
"name": "stdout",
1840-
"output_type": "stream",
1841-
"text": [
1842-
"Populating the interactive namespace from numpy and matplotlib\n"
1843-
]
1844-
},
1845-
{
1846-
"name": "stderr",
1847-
"output_type": "stream",
1848-
"text": [
1849-
"/home/peter/.local/lib/python3.6/site-packages/IPython/core/magics/pylab.py:160: UserWarning: pylab import has clobbered these variables: ['f', 'datetime']\n",
1850-
"`%matplotlib` prevents importing * from pylab and numpy\n",
1851-
" \"\\n`%matplotlib` prevents importing * from pylab and numpy\"\n"
1852-
]
1853-
}
1854-
],
1829+
"outputs": [],
18551830
"source": [
1856-
"from scipy.interpolate import interp1d\n",
1857-
"%pylab inline"
1831+
"%matplotlib inline\n",
1832+
"import numpy as np\n",
1833+
"import matplotlib.pyplot as plt\n",
1834+
"from scipy.interpolate import interp1d"
18581835
]
18591836
},
18601837
{
@@ -1919,7 +1896,7 @@
19191896
"def plot_func(func):\n",
19201897
" x = np.linspace(0, 4, num=20)\n",
19211898
" y = func(x)\n",
1922-
" plot(x, y, 'o-')\n",
1899+
" plt.plot(x, y, 'o-')\n",
19231900
" \n",
19241901
"plot_func(power_curve)"
19251902
]
@@ -3558,7 +3535,7 @@
35583535
"def print_meaning():\n",
35593536
" print(42)\n",
35603537
" \n",
3561-
"print_meaning()"
3538+
"call_print_meaning()"
35623539
]
35633540
},
35643541
{
@@ -4158,7 +4135,7 @@
41584135
},
41594136
"outputs": [],
41604137
"source": [
4161-
"with open('turbine_models.csv') as f:\n",
4138+
"with open('data-samples/turbine_models.csv') as f:\n",
41624139
" 1/0"
41634140
]
41644141
},
@@ -5287,8 +5264,8 @@
52875264
"\n",
52885265
"\n",
52895266
"- empty tuple: **`()`**\n",
5290-
"- list with one element: **`(42,)`** or in some case allowed **`42,`**\n",
5291-
"- list with many elements: **`(1,2,3)`** or **`(1,2,3,)`** or in some cases allowed **`1,2,3`** or **`1,2,3,`**"
5267+
"- tuple with one element: **`(42,)`** or in some case allowed **`42,`**\n",
5268+
"- tuple with many elements: **`(1,2,3)`** or **`(1,2,3,)`** or in some cases allowed **`1,2,3`** or **`1,2,3,`**"
52925269
]
52935270
},
52945271
{

0 commit comments

Comments
 (0)