Skip to content

Commit d47e806

Browse files
authored
Merge pull request dabeaz-course#45 from echasnovski/02-containers-fix
Make examples in '02_Containers.md' executable
2 parents 06c1f68 + 32b295c commit d47e806

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Notes/02_Working_with_data/02_Containers.md

Lines changed: 2 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

0 commit comments

Comments
 (0)