Skip to content
This repository was archived by the owner on Sep 22, 2024. It is now read-only.

Commit 367a2ea

Browse files
committed
Modified assignments
* Minor fixes related to question clarity
1 parent 59b4e09 commit 367a2ea

File tree

2 files changed

+39
-56
lines changed

2 files changed

+39
-56
lines changed

Module1.ipynb

Lines changed: 26 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -75,21 +75,21 @@
7575
"metadata": {},
7676
"outputs": [],
7777
"source": [
78-
"def <FUNCTION-NAME>():\n",
79-
" \"\"\" \n",
78+
"def function_name():\n",
79+
" \"\"\"\n",
8080
" Prints the following pattern for `n` rows:\n",
81-
" \n",
81+
"\n",
8282
" 1\n",
8383
" 1 2\n",
8484
" 1 2 3\n",
8585
" ...\n",
8686
" 1 2 3 ... n\n",
87-
" \n",
87+
"\n",
8888
" Parameters\n",
8989
" ----------\n",
9090
" n : integer\n",
9191
" Number of lines\n",
92-
" \n",
92+
"\n",
9393
" Ideas\n",
9494
" -----\n",
9595
" Looping, Nested Loops\n",
@@ -119,10 +119,10 @@
119119
"metadata": {},
120120
"outputs": [],
121121
"source": [
122-
"def <FUNCTION-NAME>():\n",
123-
" \"\"\" \n",
122+
"def function_name():\n",
123+
" \"\"\"\n",
124124
" Prints the following pattern forever (till interrupt):\n",
125-
" \n",
125+
"\n",
126126
" *\n",
127127
" 00\n",
128128
" ***\n",
@@ -132,14 +132,7 @@
132132
" ***\n",
133133
" 00\n",
134134
" *\n",
135-
" \n",
136-
" This is a vertical sinusoid.\n",
137-
" \n",
138-
" Parameters\n",
139-
" ----------\n",
140-
" n : integer\n",
141-
" Number of lines\n",
142-
" \n",
135+
"\n",
143136
" Ideas\n",
144137
" -----\n",
145138
" Looping, Conditions\n",
@@ -171,36 +164,19 @@
171164
"metadata": {},
172165
"outputs": [],
173166
"source": [
174-
"def <FUNCTION-NAME>():\n",
175-
" \"\"\" \n",
167+
"def function_name():\n",
168+
" \"\"\"\n",
176169
" Prints the following pattern forever (till interrupt):\n",
177-
" \n",
178-
" **\n",
179-
" ***\n",
180-
" *****\n",
181-
" *******\n",
182-
" ********\n",
183-
" *********\n",
184-
" *********\n",
185-
" ********\n",
186-
" *******\n",
187-
" *****\n",
188-
" ***\n",
170+
"\n",
189171
" **\n",
190-
" **\n",
191-
" ***\n",
192-
" *****\n",
193-
" *******\n",
194-
" ********\n",
195-
" *********\n",
196-
" *********\n",
197-
" ********\n",
198-
" *******\n",
199-
" *****\n",
200-
" ***\n",
172+
" ****\n",
173+
" ******\n",
174+
" ******\n",
175+
" ******\n",
176+
" ****\n",
201177
" **\n",
202178
" \n",
203-
" This is a vertical sinusoid. \n",
179+
" This is a vertical sinusoid. Use the `math.sin` function here.\n",
204180
" Note that your output need not look exactly like this.\n",
205181
" \n",
206182
" Parameters\n",
@@ -269,12 +245,12 @@
269245
"metadata": {},
270246
"outputs": [],
271247
"source": [
272-
"def <FUNCTION-NAME>():\n",
248+
"def function_name():\n",
273249
" \"\"\"\n",
274250
" For all elements in `keys`, print the value associated with them in `dictionary`.\n",
275251
" Use exception handling to take care of a non-existent key, and print the value \n",
276-
" associated with `other` instead.\n",
277-
" \n",
252+
" associated with `other` instead. Use exception handling.\n",
253+
"\n",
278254
" Ideas\n",
279255
" -----\n",
280256
" try, except\n",
@@ -313,11 +289,11 @@
313289
"metadata": {},
314290
"outputs": [],
315291
"source": [
316-
"def <FUNCTION-NAME>():\n",
292+
"def function_name():\n",
317293
" \"\"\"\n",
318294
" Round off values in `data` below the mean to 0, and those above the mean to 1\n",
319295
" Do not use looping statements.\n",
320-
" \n",
296+
"\n",
321297
" Ideas\n",
322298
" -----\n",
323299
" lambda, map\n",
@@ -347,15 +323,15 @@
347323
"metadata": {},
348324
"outputs": [],
349325
"source": [
350-
"def <FUNCTION-NAME>():\n",
326+
"def function_name():\n",
351327
" \"\"\"\n",
352328
" Return a list of all perfect squares less than `n`, using list comprehension.\n",
353-
" \n",
329+
"\n",
354330
" Parameters\n",
355331
" ----------\n",
356332
" n : integer\n",
357333
" Limit value\n",
358-
" \n",
334+
"\n",
359335
" Ideas\n",
360336
" -----\n",
361337
" Looping, If, List Comprehension\n",

Module2.ipynb

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,17 @@
126126
"metadata": {},
127127
"outputs": [],
128128
"source": [
129-
"# Call your function here\n",
130-
"\n",
131-
"dataframe = pd.read_csv('<CSV-NAME>.csv', index_col=0)\n",
132-
"dataframe.head()"
129+
"# Call your function here\n"
130+
]
131+
},
132+
{
133+
"cell_type": "code",
134+
"execution_count": null,
135+
"metadata": {},
136+
"outputs": [],
137+
"source": [
138+
"dataframe = pd.read_csv('CSVNAME.csv', index_col=0)\n",
139+
"dataframe"
133140
]
134141
},
135142
{
@@ -146,9 +153,9 @@
146153
"outputs": [],
147154
"source": [
148155
"\"\"\"\n",
149-
" Find the count of each value in `LABEL`.\n",
156+
" Find the number of occurrences of each unique value in `LABEL` (count of values).\n",
150157
" \n",
151-
" Add column `BINARY` to the DataFrame which contains 1 if `LABEL` is 2,\n",
158+
" Add a column `BINARY` to the DataFrame which contains 1 if `LABEL` is 2,\n",
152159
" else 0.\n",
153160
" \n",
154161
" Find the mean, minimum, maximum and standard deviation of `RESP` for each value in `LABEL`.\n",

0 commit comments

Comments
 (0)