Ran into trouble with pandas.DataFrame.idxmax() and made some changes
trying to figure out the problem.  Submitted issue #5648 to
pydata/pandas repo.