pandas Common mathematical statistical methods idxmax()
1, definition : Calculate the index position that can get the maximum value ( integer ).
2, Examples :
import pandas as pd import numpy as np student_info =
pd.read_csv("F:/ artificial intelligence / Scientific Computing Library /files/student_info.csv") print(student_info)
print("===========================") # idxmax() Calculate the index position that can get the maximum value ( integer )
print(student_info.idxmax()) print("===========================")
np.where(student_info["Math"]==student_info["Math"].max()) # Running results : Chinese Math
English 0 88 11.0 22.0 1 33 NaN 30.0 2 85 32.0 90.0 3 45 39.0 NaN 4 11 100.0
103.0 5 88
Technology
Daily Recommendation