Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c6dc44e

Browse files
authored
Merge branch 'master' into fix-typos
2 parents 5cf2cde + d47e806 commit c6dc44e

File tree

5 files changed

+13
-7
lines changed

5 files changed

+13
-7
lines changed

Notes/01_Introduction/02_Hello_world.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ interact with the interpreter.
5858
Let's take a closer look at the elements of the REPL:
5959

6060
- `>>>` is the interpreter prompt for starting a new statement.
61-
- `...` is the interpreter prompt for continuing a statements. Enter a blank line to finish typing and run the statements.
61+
- `...` is the interpreter prompt for continuing a statement. Enter a blank line to finish typing and run what you've entered.
6262

6363
The `...` prompt may or may not be shown depending on your environment. For this course,
6464
it is shown as blanks to make it easier to cut/paste code samples.

Notes/01_Introduction/06_Files.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ Try it:
228228
>>>
229229
```
230230

231-
### Commentary: Shouldn't we be using Pandas for this?
231+
### Commentary: Shouldn't we being using Pandas for this?
232232

233233
Data scientists are quick to point out that libraries like
234234
[Pandas](https://pandas.pydata.org) already have a function for

Notes/02_Working_with_data/02_Containers.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,10 @@ An example when reading records from a file.
5252
records = [] # Initial empty list
5353

5454
with open('Data/portfolio.csv', 'rt') as f:
55+
next(f) # Skip header
5556
for line in f:
5657
row = line.split(',')
57-
records.append((row[0], int(row[1])), float(row[2]))
58+
records.append((row[0], int(row[1]), float(row[2])))
5859
```
5960

6061
### Dicts as a Container
@@ -105,6 +106,11 @@ with open('Data/prices.csv', 'rt') as f:
105106
prices[row[0]] = float(row[1])
106107
```
107108

109+
Note: If you try this on the `Data/prices.csv` file, you'll find that
110+
it almost works--there's a blank line at the end that causes it to
111+
crash. You'll need to figure out some way to modify the code to
112+
account for that (see Exercise 2.6).
113+
108114
### Dictionary Lookups
109115

110116
You can test the existence of a key.

Notes/02_Working_with_data/06_List_comprehension.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ for variable_name in sequence:
8080

8181
### Historical Digression
8282

83-
List comprehension come from math (set-builder notation).
83+
List comprehensions come from math (set-builder notation).
8484

8585
```code
8686
a = [ x * x for x in s if x > 0 ] # Python

Notes/05_Object_model/01_Dicts_revisited.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ involving dictionaries. This section discusses that.
77

88
### Dictionaries, Revisited
99

10-
Remember that a dictionary is a collection of names values.
10+
Remember that a dictionary is a collection of named values.
1111

1212
```python
1313
stock = {
@@ -58,7 +58,7 @@ A dictionary holds the instance data, `__dict__`.
5858
```python
5959
>>> s = Stock('GOOG', 100, 490.1)
6060
>>> s.__dict__
61-
{'name' : 'GOOG','shares' : 100, 'price': 490.1 }
61+
{'name' : 'GOOG', 'shares' : 100, 'price': 490.1 }
6262
```
6363

6464
You populate this dict (and instance) when assigning to `self`.
@@ -271,7 +271,7 @@ e = E()
271271
e.attr
272272
```
273273

274-
A attribute search process is carried out, but what is the order? That's a problem.
274+
An attribute search process is carried out, but what is the order? That's a problem.
275275

276276
Python uses *cooperative multiple inheritance* which obeys some rules
277277
about class ordering.

0 commit comments

Comments
 (0)