I am trying to calculate the biggest difference between summer gold medal counts and winter gold medal counts relative to their total gold medal count. The problem is that
This looks like a question from the programming assignment of courser course - "Introduction to Data Science in Python"
Having said that if you are not cheating "maybe" the bug is here:
Gold_Y = df2[(df2['Gold'] > 1) | (df2['Gold.1'] > 1)]
You should use the &
operator. The |
operator means you have countries that have won Gold in either the Summer or Winter olympics.
You should not get a NaN
in your diff gold.