Answers for "python pandas shift last column to first place"

0

python pandas shift last column to first place

cols = list(df.columns)
cols = [cols[-1]] + cols[:-1]
df = df[cols]
Posted by: Guest on February-19-2022

Code answers related to "python pandas shift last column to first place"

Python Answers by Framework

Browse Popular Code Answers by Language