Skip to content

Commit 64ff45f

Browse files
author
giumas
committed
006 and 007 changes after Roxy comments
1 parent 7905622 commit 64ff45f

2 files changed

+25
-93
lines changed

006_Read_and_Write_Text_Files.ipynb

+21-89
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"source": [
2222
"You have learned about lists as well as how to write your own functions with loops and conditional statements. As such, you can already write programs performing a variety of tasks. \n",
2323
"\n",
24-
"However, something that is currently missing is a mechanism to access the data that you want to analyze. A very common way to access these data is through (local or remotely-stored) [files](https://en.wikipedia.org/wiki/Computer_file)."
24+
"However, something that you are currently missing is a mechanism to access the data that you want to analyze. A very common way to access these data is through (local or remotely-stored) [files](https://en.wikipedia.org/wiki/Computer_file)."
2525
]
2626
},
2727
{
@@ -78,7 +78,7 @@
7878
"cell_type": "markdown",
7979
"metadata": {},
8080
"source": [
81-
"We will first introduce some file managing capability of the `os` [Python module](https://docs.python.org/3.6/tutorial/modules.html#modules), then we will describe the use of the functions that Python natively provides for [reading and writing the content of a text file](https://docs.python.org/3.6/tutorial/inputoutput.html)."
81+
"We will first introduce some file managing capability of the `os` [Python module](https://docs.python.org/3.6/tutorial/modules.html#modules), then we will describe the use of the functions that Python provides for [reading and writing the content of a text file](https://docs.python.org/3.6/tutorial/inputoutput.html)."
8282
]
8383
},
8484
{
@@ -127,17 +127,9 @@
127127
},
128128
{
129129
"cell_type": "code",
130-
"execution_count": 1,
131-
"metadata": {},
132-
"outputs": [
133-
{
134-
"name": "stdout",
135-
"output_type": "stream",
136-
"text": [
137-
"The current folder is: C:\\code\\hyo2\\epom\\python_basics\n"
138-
]
139-
}
140-
],
130+
"execution_count": null,
131+
"metadata": {},
132+
"outputs": [],
141133
"source": [
142134
"import os\n",
143135
"\n",
@@ -176,17 +168,9 @@
176168
},
177169
{
178170
"cell_type": "code",
179-
"execution_count": 2,
180-
"metadata": {},
181-
"outputs": [
182-
{
183-
"name": "stdout",
184-
"output_type": "stream",
185-
"text": [
186-
"The data folder is: C:\\code\\hyo2\\epom\\python_basics\\data\n"
187-
]
188-
}
189-
],
171+
"execution_count": null,
172+
"metadata": {},
173+
"outputs": [],
190174
"source": [
191175
"def get_data_folder():\n",
192176
" cur_folder = os.path.abspath(os.path.curdir)\n",
@@ -226,17 +210,9 @@
226210
},
227211
{
228212
"cell_type": "code",
229-
"execution_count": 3,
230-
"metadata": {},
231-
"outputs": [
232-
{
233-
"name": "stdout",
234-
"output_type": "stream",
235-
"text": [
236-
"The data paths are: ['C:\\\\code\\\\hyo2\\\\epom\\\\python_basics\\\\data\\\\ctd.txt', 'C:\\\\code\\\\hyo2\\\\epom\\\\python_basics\\\\data\\\\sal.txt', 'C:\\\\code\\\\hyo2\\\\epom\\\\python_basics\\\\data\\\\temp.txt']\n"
237-
]
238-
}
239-
],
213+
"execution_count": null,
214+
"metadata": {},
215+
"outputs": [],
240216
"source": [
241217
"def get_data_paths():\n",
242218
" data_paths = list() # create a empty list that will be populate and returned\n",
@@ -289,17 +265,9 @@
289265
},
290266
{
291267
"cell_type": "code",
292-
"execution_count": 4,
293-
"metadata": {},
294-
"outputs": [
295-
{
296-
"name": "stdout",
297-
"output_type": "stream",
298-
"text": [
299-
"The file path with index 1 is: C:\\code\\hyo2\\epom\\python_basics\\data\\sal.txt\n"
300-
]
301-
}
302-
],
268+
"execution_count": null,
269+
"metadata": {},
270+
"outputs": [],
303271
"source": [
304272
"sal_path = retrieved_paths[1]\n",
305273
"print(\"The file path with index 1 is: \" + sal_path)"
@@ -379,37 +347,9 @@
379347
},
380348
{
381349
"cell_type": "code",
382-
"execution_count": 5,
383-
"metadata": {},
384-
"outputs": [
385-
{
386-
"name": "stdout",
387-
"output_type": "stream",
388-
"text": [
389-
"31.4\n",
390-
"31.6\n",
391-
"30.5\n",
392-
"30.8\n",
393-
"30.4\n",
394-
"31.4\n",
395-
"31.6\n",
396-
"30.5\n",
397-
"30.3\n",
398-
"30.2\n",
399-
"31.4\n",
400-
"31.6\n",
401-
"32.5\n",
402-
"30.8\n",
403-
"31.4\n",
404-
"31.7\n",
405-
"31.6\n",
406-
"31.5\n",
407-
"30.2\n",
408-
"30.4\n",
409-
"\n"
410-
]
411-
}
412-
],
350+
"execution_count": null,
351+
"metadata": {},
352+
"outputs": [],
413353
"source": [
414354
"sal_file = open(sal_path)\n",
415355
"\n",
@@ -568,17 +508,9 @@
568508
},
569509
{
570510
"cell_type": "code",
571-
"execution_count": 6,
572-
"metadata": {},
573-
"outputs": [
574-
{
575-
"name": "stdout",
576-
"output_type": "stream",
577-
"text": [
578-
"The output folder is: C:\\code\\hyo2\\epom\\python_basics\\output\n"
579-
]
580-
}
581-
],
511+
"execution_count": null,
512+
"metadata": {},
513+
"outputs": [],
582514
"source": [
583515
"def get_output_folder():\n",
584516
" cur_folder = os.path.abspath(os.path.curdir)\n",
@@ -618,7 +550,7 @@
618550
},
619551
{
620552
"cell_type": "code",
621-
"execution_count": 7,
553+
"execution_count": null,
622554
"metadata": {},
623555
"outputs": [],
624556
"source": [

007_Dictionaries_and_Metadata.ipynb

+4-4
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@
1919
"cell_type": "markdown",
2020
"metadata": {},
2121
"source": [
22-
"It is time to enrich your baggage of Python containers with a new useful one: the `dict`.\n",
22+
"It is time to enrich your knowledge of Python containers with a useful new one: the `dict`.\n",
2323
"\n",
24-
"Each item in a `dict` is represented by a pair of a key and the corresponding value. \n",
24+
"Each item in a `dict` is represented by a pair with a key and the corresponding value. \n",
2525
"\n",
26-
"For example, a `dict` can be used to map a [chemical symbol](https://en.wikipedia.org/wiki/Symbol_(chemistry)) to the corresponding element name. Thus, a possible pair would be `H` as symbol and `Hydrogen` as element name."
26+
"For example, a `dict` can be used to map a [chemical symbol](https://en.wikipedia.org/wiki/Symbol_(chemistry)) to the corresponding element name. Thus, a possible pair would be `H` as symbol and `Hydrogen` as the element name."
2727
]
2828
},
2929
{
@@ -531,7 +531,7 @@
531531
"source": [
532532
"We now introduce a new method that achieves the same result by using the `%` modulo operator.\n",
533533
"\n",
534-
"These are a couple of examples of its usage:"
534+
"Below are a couple of examples of its usage:"
535535
]
536536
},
537537
{

0 commit comments

Comments
 (0)