Skip to content

Commit 94d3ea9

Browse files
committed
fixed typos, added watermark info
1 parent 9db24a8 commit 94d3ea9

2 files changed

Lines changed: 79 additions & 20 deletions

File tree

tutorials/python_data_entry_point.ipynb

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"metadata": {
33
"name": "",
4-
"signature": "sha256:27a1e02eab6a2a036c525e3b099008ab58937df3266f55f5072b9a68b1693306"
4+
"signature": "sha256:7417613f49b14e98fba46fa1e285f4e3d46728b4798e853cfb103caef077b452"
55
},
66
"nbformat": 3,
77
"nbformat_minor": 0,
@@ -25,10 +25,18 @@
2525
"cell_type": "code",
2626
"collapsed": false,
2727
"input": [
28-
"import time\n",
29-
"import platform\n",
30-
"print('Last updated: %s' %time.strftime('%d/%m/%Y'))\n",
31-
"print('Created using Python', platform.python_version())"
28+
"%load_ext watermark"
29+
],
30+
"language": "python",
31+
"metadata": {},
32+
"outputs": [],
33+
"prompt_number": 1
34+
},
35+
{
36+
"cell_type": "code",
37+
"collapsed": false,
38+
"input": [
39+
"%watermark -a 'Sebastian Raschka' -v -d -p numpy,scipy,matplotlib,scikit-learn"
3240
],
3341
"language": "python",
3442
"metadata": {},
@@ -37,12 +45,26 @@
3745
"output_type": "stream",
3846
"stream": "stdout",
3947
"text": [
40-
"Last updated: 26/06/2014\n",
41-
"Created using Python 3.4.1\n"
48+
"Sebastian Raschka 04/07/2014 \n",
49+
"\n",
50+
"CPython 3.4.1\n",
51+
"IPython 2.1.0\n",
52+
"\n",
53+
"numpy 1.8.1\n",
54+
"scipy 0.14.0\n",
55+
"matplotlib 1.3.1\n",
56+
"scikit-learn 0.15.0b1\n"
4257
]
4358
}
4459
],
45-
"prompt_number": 1
60+
"prompt_number": 5
61+
},
62+
{
63+
"cell_type": "markdown",
64+
"metadata": {},
65+
"source": [
66+
"<font size=\"1.5em\">[More information](http://nbviewer.ipython.org/github/rasbt/python_reference/blob/master/ipython_magic/watermark.ipynb) about the `watermark` magic command extension.</font>"
67+
]
4668
},
4769
{
4870
"cell_type": "markdown",

tutorials/scope_resolution_legb_rule.ipynb

Lines changed: 49 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"metadata": {
33
"name": "",
4-
"signature": "sha256:134ba1fb10441f1756c0ab8a2ecef528f9c1cfd7543d8df415e2ae855f6891f9"
4+
"signature": "sha256:b33e0c5563d80d68580ea6ce62ae2703856ccde40aec8ff9fb1364ac70d70521"
55
},
66
"nbformat": 3,
77
"nbformat_minor": 0,
@@ -13,22 +13,59 @@
1313
"metadata": {},
1414
"source": [
1515
"[Sebastian Raschka](http://www.sebastianraschka.com) \n",
16-
"last updated: 04/28/2014\n",
1716
"\n",
1817
"- [Link to the containing GitHub Repository](https://github.com/rasbt/python_reference)\n",
19-
"- [Link to this IPython Notebook on GitHub](https://github.com/rasbt/python_reference/blob/master/tutorials/scope_resolution_legb_rule.ipynb)\n",
20-
"\n",
21-
"Note: The code in this IPython notebook was executed in Python 3.4.0"
18+
"- [Link to this IPython Notebook on GitHub](https://github.com/rasbt/python_reference/blob/master/tutorials/scope_resolution_legb_rule.ipynb)\n"
19+
]
20+
},
21+
{
22+
"cell_type": "code",
23+
"collapsed": false,
24+
"input": [
25+
"%load_ext watermark"
26+
],
27+
"language": "python",
28+
"metadata": {},
29+
"outputs": [],
30+
"prompt_number": 1
31+
},
32+
{
33+
"cell_type": "code",
34+
"collapsed": false,
35+
"input": [
36+
"%watermark -a 'Sebastian Raschka' -v -d"
37+
],
38+
"language": "python",
39+
"metadata": {},
40+
"outputs": [
41+
{
42+
"output_type": "stream",
43+
"stream": "stdout",
44+
"text": [
45+
"Sebastian Raschka 04/07/2014 \n",
46+
"\n",
47+
"CPython 3.3.5\n",
48+
"IPython 2.1.0\n"
49+
]
50+
}
51+
],
52+
"prompt_number": 3
53+
},
54+
{
55+
"cell_type": "markdown",
56+
"metadata": {},
57+
"source": [
58+
"<font size=\"1.5em\">[More information](http://nbviewer.ipython.org/github/rasbt/python_reference/blob/master/ipython_magic/watermark.ipynb) about the `watermark` magic command extension.</font>"
2259
]
2360
},
2461
{
2562
"cell_type": "markdown",
2663
"metadata": {},
2764
"source": [
2865
"<hr>\n",
29-
"I am really looking forward to your comments and suggestions to improve and extend this tutorial! Just send me a quick note \n",
30-
"via Twitter: [&#64;rasbt](https://twitter.com/rasbt) \n",
31-
"or Email: [[email protected]](mailto:bluewoodtree@gmail.com)\n",
66+
"I would be happy to hear your comments and suggestions. \n",
67+
"Please feel free to drop me a note via\n",
68+
"[twitter](https://twitter.com/rasbt), [email](mailto:[email protected]), or [google+](https://plus.google.com/+SebastianRaschka).\n",
3269
"<hr>"
3370
]
3471
},
@@ -207,7 +244,7 @@
207244
"cell_type": "markdown",
208245
"metadata": {},
209246
"source": [
210-
"So, how does Python now which namespace it has to search if we want to print the value of the variable `i`? This is where Python's LEGB-rule comes into play, which we will discuss in the next section."
247+
"So, how does Python know which namespace it has to search if we want to print the value of the variable `i`? This is where Python's LEGB-rule comes into play, which we will discuss in the next section."
211248
]
212249
},
213250
{
@@ -274,7 +311,7 @@
274311
"- *Global* refers to the uppermost level of the executing script itself, and \n",
275312
"- *Built-in* are special names that Python reserves for itself. \n",
276313
"\n",
277-
"So, if a particular name:object mapping cannot be found in the local namespaces, the namespaces of the enclosed scope are being searched next. If the search in the enclosed scope is unsuccessful, too, Python moves on to the global namespace, and eventually, it will search the global namespaces (side note: if a name cannot found in any of the namespaces, a *NameError* will is raised).\n",
314+
"So, if a particular name:object mapping cannot be found in the local namespaces, the namespaces of the enclosed scope are being searched next. If the search in the enclosed scope is unsuccessful, too, Python moves on to the global namespace, and eventually, it will search the built-in namespace (side note: if a name cannot found in any of the namespaces, a *NameError* will is raised).\n",
278315
"\n",
279316
"**Note**: \n",
280317
"Namespaces can also be further nested, for example if we import modules, or if we are defining new classes. In those cases we have to use prefixes to access those nested namespaces. Let me illustrate this concept in the following code block:"
@@ -635,7 +672,7 @@
635672
"cell_type": "markdown",
636673
"metadata": {},
637674
"source": [
638-
"Similar to the concept of the `global` keyword, which we have seen in the section above, we can use the keyword `nonlocal` inside the inner function to explicitely access a variable from the outer (enclosed) scope in order to modify its value. \n",
675+
"Similar to the concept of the `global` keyword, which we have seen in the section above, we can use the keyword `nonlocal` inside the inner function to explicitly access a variable from the outer (enclosed) scope in order to modify its value. \n",
639676
"Note that the `nonlocal` keyword was added in Python 3.x and is not implemented in Python 2.x (yet)."
640677
]
641678
},
@@ -1020,7 +1057,7 @@
10201057
"cell_type": "markdown",
10211058
"metadata": {},
10221059
"source": [
1023-
"**This also applies if we explicitely defined the `for-loop` variable in the global namespace before!** In this case it will rebind the existing variable:"
1060+
"**This also applies if we explicitly defined the `for-loop` variable in the global namespace before!** In this case it will rebind the existing variable:"
10241061
]
10251062
},
10261063
{

0 commit comments

Comments
 (0)