Skip to content

Commit 829265e

Browse files
authored
Merge pull request #142 from LibraryCarpentry/chennesy-patch-2
Update looping-data-sets.md
2 parents 5a60d9f + fe11581 commit 829265e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

episodes/looping-data-sets.md

+1
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)