I do not understand why this works
df[(df['Gold']>0) & (df['Gold.1']>0)].loc[((df['Gold'] - df['Gold.1'])/(df['Gold'])).abs().idxmax()]
but when I divide by (df['Gold'] + df['Gold.1'] + df['Gold.2'])
it stops working giving me error that you can find below.
Interestingly, the following line works
df.loc[((df['Gold'] - df['Gold.1'])/(df['Gold'] + df['Gold.1'] + df['Gold.2'])).abs().idxmax()]
I do not understand what is happening since I just started to learn Python and Pandas. I need to understand the reason why this happens and how to fix it.
ERROR
KeyError: 'the label [Algeria] is not in the [index]'