【问题标题】:How to show which column is max in pandas如何在熊猫中显示哪一列最大
【发布时间】:2022-06-16 11:56:21
【问题描述】:

这是我的数据集

Id        Math        Physics       Chemistry
1           53             61              35
2           67             43              55

这是我的加速输出

Id        Math        Physics       Chemistry        Highest
1           53             61              35        Physics
2           67             43              55        Math

【问题讨论】:

  • df['Highest'] = df.iloc[:, 1:].idxmax(axis=1)?

标签: python pandas dataframe


猜你喜欢
  • 2017-01-14
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-08-17
  • 1970-01-01
  • 2021-02-24
  • 2022-01-16
相关资源
最近更新 更多