Max value using idxmax

前端 未结 8 1469
情歌与酒
情歌与酒 2020-12-22 04:55

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

8条回答
  •  借酒劲吻你
    2020-12-22 05:14

    def answer_three():
         atleast_one_gold = df[(df['Gold']>1) & (df['Gold.1']> 1)]
         return ((atleast_one_gold['Gold'] - atleast_one_gold['Gold.1'])/atleast_one_gold['Gold.2']).idxmax()
    
    answer_three()
    

提交回复
热议问题