Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

get column index of maximum value in each row pandas

>>> df.idxmax(axis=1)
0    Communications
1          Business
2    Communications
3    Communications
4          Business
dtype: object
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #column #index #maximum #row #pandas
ADD COMMENT
Topic
Name
7+2 =