DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
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
COMMENT
Name
5+2 =
Submit