生成数据 import pandas as pd df: pd.DataFrame = pd.DataFrame([ [1, 4.2], [70, 0.03], [5, 0] ], columns=['one', 'two']) onetwo014.21700.03250 最大值对应的index print(df.idxmax()) one 1 two 0 dtype: int64 最小值对应的index print(df.idxmin()) one 0 two 2 dtype: int64