From b0855f7f24ef6f5bd34f53178055bb35d0007d96 Mon Sep 17 00:00:00 2001 From: wgriffa Date: Tue, 17 Oct 2023 07:51:03 -0400 Subject: [PATCH] Update 14-looping-data-sets.md 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. --- episodes/14-looping-data-sets.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/episodes/14-looping-data-sets.md b/episodes/14-looping-data-sets.md index ec19be367..abe22a874 100644 --- a/episodes/14-looping-data-sets.md +++ b/episodes/14-looping-data-sets.md @@ -201,7 +201,7 @@ for filename in glob.glob('data/gapminder_gdp*.csv'): # retrieve the last string in the list that split returns (`.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() ```