Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to move the last column to the first column in pandas

cols = [df.columns[-1]] + [col for col in df if col != df.columns[-1]]
df = df[cols]
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #move #column #column #pandas
ADD COMMENT
Topic
Name
4+7 =