From f29b58b5f105ba24957bfd4b9cef6e9a89eb5fc2 Mon Sep 17 00:00:00 2001 From: mady490 <43937782+mady490@users.noreply.github.com> Date: Sun, 12 Apr 2020 03:32:59 +0530 Subject: [PATCH] updated example 3 we don't need to do the drop step if we follow this way also I loved you idmax function in almost all the solution. could you please tell me where did you refer when you were doing this intro to DS course thanks --- Assignment+2.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Assignment+2.py b/Assignment+2.py index 8395c77..27d1afd 100644 --- a/Assignment+2.py +++ b/Assignment+2.py @@ -97,8 +97,7 @@ def answer_two(): # In[5]: def answer_three(): - only_gold = df.where((df['Gold'] > 0) & (df['Gold.1'] > 0)) - only_gold = only_gold.dropna() + only_gold = df[(df['Gold'] > 0) & (df['Gold.1']>0)] return (abs((only_gold['Gold'] - only_gold['Gold.1']) / only_gold['Gold.2'])).idxmax() answer_three()