Skip to content

Commit

Permalink
Update 14-looping-data-sets.md
Browse files Browse the repository at this point in the history
This avoids the FutureWarning: The default value of numeric_only in DataFrame.mean is deprecated. In a future version, it will default to False. In addition, specifying 'numeric_only=None' is deprecated. Select only valid columns or specify the value of numeric_only to silence this warning.
  • Loading branch information
wgriffa authored Oct 17, 2023
1 parent 2408c73 commit b0855f7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion episodes/14-looping-data-sets.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ for filename in glob.glob('data/gapminder_gdp*.csv'):
# retrieve the last string in the list that split returns (`<region>.csv`),
# and then remove the `.csv` extension from that string.
region = filename.split('_')[-1][:-4]
dataframe.mean().plot(ax=ax, label=region)
dataframe.mean(numeric_only=True).plot(ax=ax, label=region)
plt.legend()
plt.show()
```
Expand Down

0 comments on commit b0855f7

Please sign in to comment.