Skip to content

Commit fe11581

Browse files
authored
Update looping-data-sets.md
add import statement at beginning of episode (via learner feedback)
1 parent 905bea7 commit fe11581

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

episodes/looping-data-sets.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ exercises: 10
2323
If you recall from episode 06, the `pd.read_csv()` method takes a text string referencing a filename as an argument. If we have a list of strings that point to our filenames, we can loop through the list to read in each CSV file as a DataFrame. Let's print out the maximum values from the 'ytd' (year to date) column for each DataFrame.
2424

2525
```python
26+
import pandas as pd
2627
for filename in ['data/2011_circ.csv', 'data/2012_circ.csv']:
2728
data = pd.read_csv(filename)
2829
print(filename, data['ytd'].max())

0 commit comments

Comments
 (0)