Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

display Max rows in a pandas dataframe

pandas.set_option('display.max_rows', None)
Comment

Display max number of columns and rows pandas

# displays max number of columns and rows


import pandas as pd
pd.options.display.max_rows = 999
pd.options.display.max_columns = 999
Comment

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
Comment

pandas find column with max value for each row

# credit to Stack Overflow in the source link

df.head()
Communications and Search   Business    General Lifestyle
0   0.745763    0.050847    0.118644    0.084746
0   0.333333    0.000000    0.583333    0.083333
0   0.617021    0.042553    0.297872    0.042553
0   0.435897    0.000000    0.410256    0.153846
0   0.358974    0.076923    0.410256    0.153846

df.idxmax(axis=1)
0    Communications
1          Business
2    Communications
3    Communications
4          Business
dtype: object
Comment

PREVIOUS NEXT
Code Example
Python :: find email address pytho 
Python :: default dictionary value 
Python :: python dataframe add row 
Python :: numpy replace all values with another 
Python :: includes python 
Python :: python int to scientific string 
Python :: Print characters from a string that are present at an even index number 
Python :: RMSE value from cross validation 
Python :: how to use with statementin python 2.4 
Python :: unique list 
Python :: django give access to media folder 
Python :: python string [::-1] 
Python :: multithreaded programming in python 
Python :: k fold cross validation xgboost python 
Python :: python integers 
Python :: how to maximize the screen in selenium 
Python :: quotation marks n string 
Python :: django models filter 
Python :: best time to buy and sell stock python 
Python :: Using replace() method to remove newlines from a string 
Python :: python popen 
Python :: pandas check is field is null or empty 
Python :: python write data to file with permissions 
Python :: convert float with missing values to integer 
Python :: pyhton comment 
Python :: import modules given the full path python 
Python :: django q example 
Python :: json.stringify equivalent in python 
Python :: python largest common divisor 
Python :: __slots__ python example 
ADD CONTENT
Topic
Content
Source link
Name
7+5 =