It can be a good exercise to attempt an implementation of a built-in DataFrame method on your own. This type of replication can give you a deeper understanding of other pandas methods that you normally wouldn't have come across. idxmax is a challenging method to replicate using only the methods covered thus far in the book.
Replicating idxmax with method chaining
Getting ready
This recipe slowly chains together basic methods to eventually find all the row index values that contain a maximum column value.
How to do it...
- Load in the college dataset and execute the...