Skip to content

Commit

Permalink
cleaned up
Browse files Browse the repository at this point in the history
  • Loading branch information
nikk-nikaznan committed Dec 3, 2024
1 parent 7975a6c commit 2c5f20e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions episodes/14-looping-data-sets.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,11 +192,12 @@ to either filter out those columns or tell pandas to ignore them.
This solution builds a useful legend by using the [string `split` method][split-method] to
extract the `region` from the path 'data/gapminder\_gdp\_a\_specific\_region.csv'.

```import glob
```python
import glob
import pandas as pd
import matplotlib.pyplot as plt
fig, ax = plt.subplots(1,1)
for filename in glob.glob('/Users/nikkhadijahnikaznan/Downloads/data/gapminder_gdp*.csv'):
for filename in glob.glob('data/gapminder_gdp*.csv'):
dataframe = pd.read_csv(filename)
# extract <region> from the filename, expected to be in the format 'data/gapminder_gdp_<region>.csv'.
# we will split the string using the split method and `_` as our separator,
Expand Down

0 comments on commit 2c5f20e

Please sign in to comment.