From b01760aca680adb2dc29055077a716b80cbbd82c Mon Sep 17 00:00:00 2001 From: Amirali Toori <103496001+AmiraliToori@users.noreply.github.com> Date: Tue, 2 Jul 2024 14:35:12 +0330 Subject: [PATCH] Fix: Exercise_with_Solutions.ipynb, a slight fix at the step 16 at step 16, change a syntax which leads to an error: order_group.mean()['revenue'] is incorrect. we could not get the mean from all of the columns in order_group (some of them are string), so we need to select column 'revenue', which we just right created, the correct syntax is: order_group['revenue'].mean() --- .../Chipotle/Exercise_with_Solutions.ipynb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/01_Getting_&_Knowing_Your_Data/Chipotle/Exercise_with_Solutions.ipynb b/01_Getting_&_Knowing_Your_Data/Chipotle/Exercise_with_Solutions.ipynb index 32d1e7df8..f66fc71d2 100644 --- a/01_Getting_&_Knowing_Your_Data/Chipotle/Exercise_with_Solutions.ipynb +++ b/01_Getting_&_Knowing_Your_Data/Chipotle/Exercise_with_Solutions.ipynb @@ -737,7 +737,7 @@ "\n", "chipo['revenue'] = chipo['quantity'] * chipo['item_price']\n", "order_grouped = chipo.groupby(by=['order_id']).sum()\n", - "order_grouped.mean()['revenue']" + "order_grouped['revenue'].mean()" ] }, { @@ -761,7 +761,7 @@ "source": [ "# Solution 2\n", "\n", - "chipo.groupby(by=['order_id']).sum().mean()['revenue']" + "chipo.groupby(by=['order_id']).sum()['revenue'].mean()" ] }, {