df['dfda']=pd.Series(df[['a','b','v']].idxmax(axis=1),index=df.index)#横向比较最大值并返回列名,比循环快N倍 转载于:https://www.cnblogs.com/mahailuo/p/8316003.html