get the maximum value for each row

Post date: Aug 14, 2014 7:58:41 AM

Just use .max() and specify the axis, axis=1 --> across the columns.

>>> frame['HighScore'] = frame[['test1','test2','test3']].max(axis=1) >>> frame     name  test1  test2  test3  HighScore 0   bill     85     35     51         85 1    joe     75     45     61         75 2  steve     85     83     45         85

from: http://stackoverflow.com/questions/20033111/python-pandas-max-value-of-selected-columns