'How do you find index of max value of a single column or row in a pandas dataframe?

I know that I can get the max value for EVERY column or row by changing the axis between 0 and 1 in max_elements, and similarly can get the location of a max value for EVERY column/row, but how do I find just the max value and its index in a SINGLE column or row?

max_elements = df_test_bid.max(axis=1)
print((max_elements))
#gives me all max values 


maxValueIndex = df_test_bid.idxmax(axis = 1)
print(maxValueIndex)
#gives me all max value locations


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source