Skip to content

Commit 23b893c

Browse files
authored
Merge pull request #15 from PracticumAI/May_updates
May updates
2 parents 2b53690 + eb2dd02 commit 23b893c

File tree

6 files changed

+28
-61
lines changed

6 files changed

+28
-61
lines changed

01.1_getting_started.ipynb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@
207207
},
208208
"outputs": [],
209209
"source": [
210+
"z = 3\n",
210211
"z + 0.14"
211212
]
212213
},

01.2_getting_started.ipynb

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -46,20 +46,6 @@
4646
"Fix the codeblock above to print both the Spanish and Arabic greeting text."
4747
]
4848
},
49-
{
50-
"cell_type": "code",
51-
"execution_count": null,
52-
"metadata": {},
53-
"outputs": [],
54-
"source": [
55-
"# One possible solution for instructor version\n",
56-
"\n",
57-
"spanish_greeting = 'Hola'\n",
58-
"print(spanish_greeting)\n",
59-
"arabic_greeting = 'Ahlan was sahlan'\n",
60-
"print(arabic_greeting)"
61-
]
62-
},
6349
{
6450
"cell_type": "markdown",
6551
"metadata": {},
@@ -150,21 +136,6 @@
150136
"```"
151137
]
152138
},
153-
{
154-
"cell_type": "markdown",
155-
"metadata": {},
156-
"source": [
157-
"#### 1.1.2. `.format()` formatting\n",
158-
"\n",
159-
"The `.format()` method works by placing replacement fields in the text using curly braces, \"{}\". The values to interpolate are passes in the `.format()` method.\n",
160-
"\n",
161-
"[This article](https://www.geeksforgeeks.org/python-string-format-method/) provides more information and examples of the `.format()` method.\n",
162-
"\n",
163-
"```python\n",
164-
"print(\"{} fans like {} {}%!\".format(mascot, likes, how_much))\n",
165-
"```"
166-
]
167-
},
168139
{
169140
"cell_type": "code",
170141
"execution_count": null,

02.1_libraries.ipynb

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -72,43 +72,15 @@
7272
"help(math)"
7373
]
7474
},
75-
{
76-
"cell_type": "code",
77-
"execution_count": null,
78-
"metadata": {},
79-
"outputs": [],
80-
"source": [
81-
"NAME\n",
82-
" math\n",
83-
"\n",
84-
"MODULE REFERENCE\n",
85-
" http://docs.python.org/3/library/math\n",
86-
"\n",
87-
" The following documentation is automatically generated from the Python\n",
88-
" source files. It may be incomplete, incorrect or include features that\n",
89-
" are considered implementation detail and may vary between Python\n",
90-
" implementations. When in doubt, consult the module reference at the\n",
91-
" location listed above.\n",
92-
"\n",
93-
"DESCRIPTION\n",
94-
" This module is always available. It provides access to the\n",
95-
" mathematical functions defined by the C standard.\n",
96-
"\n",
97-
"FUNCTIONS\n",
98-
" acos(...)\n",
99-
" acos(x)\n",
100-
"\n",
101-
" Return the arc cosine (measured in radians) of x."
102-
]
103-
},
10475
{
10576
"cell_type": "markdown",
10677
"metadata": {},
10778
"source": [
10879
"## 2. Import specific items from a library module to shorten programs\n",
10980
"\n",
11081
"* >Use `from ______ import _____` to load only specific items from a library.\n",
111-
"* Then refer to them directly without library name as prefix."
82+
"* Then refer to them directly without library name as prefix.\n",
83+
"* It is not a good idea to import *everything* from a library this way...e.g. you may see examples that suggest something like `from math import *`. That is likely to create namespace problems and other issues and is not recommended. "
11284
]
11385
},
11486
{

03.2_conditionals.ipynb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,12 @@
416416
"cell_type": "markdown",
417417
"metadata": {},
418418
"source": [
419-
"so it is perfectly clear to a reader (and to Python) what you really mean."
419+
"so it is perfectly clear to a reader (and to Python) what you really mean.\n",
420+
"\n",
421+
"\n",
422+
"<div style=\"padding: 10px;margin-bottom: 20px;border: thin solid #E5C250;border-left-width: 10px;background-color: #fff\">\n",
423+
" <p><strong>Tip:</strong> Try to keep code simple and easy to read. In the example above, parentheses help, but is still a bit unclear and could use some comments to help a reader understand the logic behind the code.</p>\n",
424+
" </div>"
420425
]
421426
},
422427
{

03.3_functions.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@
445445
"rich = \"gold\"\n",
446446
"poor = \"tin\"\n",
447447
"print(max(rich, poor))\n",
448-
"print(max(len(rich, len(poor)))"
448+
"print(max(len(rich, len(poor))))"
449449
]
450450
},
451451
{

04.2_data_wrangling.ipynb

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,24 @@
171171
"pd.plotting.scatter_matrix(df)"
172172
]
173173
},
174+
{
175+
"cell_type": "markdown",
176+
"metadata": {},
177+
"source": [
178+
"### 2.2 Saving plots\n",
179+
"\n",
180+
"We may want to save the output of a plot. This can be done using the `plt.savefig()` function. By default, the format will be determined from the filename extension you provide."
181+
]
182+
},
183+
{
184+
"cell_type": "code",
185+
"execution_count": null,
186+
"metadata": {},
187+
"outputs": [],
188+
"source": [
189+
"plt.savefil('plot.pdf')"
190+
]
191+
},
174192
{
175193
"cell_type": "markdown",
176194
"metadata": {},

0 commit comments

Comments
 (0)