From 7abbe00cb1500526b5e5b67e78813e1f8e8989d1 Mon Sep 17 00:00:00 2001 From: NimaAfshari Date: Tue, 16 Apr 2024 08:13:01 +0800 Subject: [PATCH] [fix] Level keyword is deprecated from pandas v1.3 --- 100-pandas-puzzles-with-solutions.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/100-pandas-puzzles-with-solutions.ipynb b/100-pandas-puzzles-with-solutions.ipynb index 0b5927d3d..a30c96794 100644 --- a/100-pandas-puzzles-with-solutions.ipynb +++ b/100-pandas-puzzles-with-solutions.ipynb @@ -595,7 +595,7 @@ "df = pd.DataFrame({'grps': list('aaabbcaabcccbbc'), \n", " 'vals': [12,345,3,1,45,14,4,52,54,23,235,21,57,3,87]})\n", "\n", - "df.groupby('grps')['vals'].nlargest(3).sum(level=0)" + "df.groupby('grps')['vals'].nlargest(3).groupby('grps').sum()" ] }, {