Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

pandas switch column levels

df = df.reorder_levels(column_names, axis)
# axis => {0 or ‘index’, 1 or ‘columns’}, default 0
# column_names => List representing new level order. Reference level by number (position) or by key (label).
 
PREVIOUS NEXT
Tagged: #pandas #switch #column #levels
ADD COMMENT
Topic
Name
4+5 =