pandas move column in front of other column site:stackoverflow.com code example Example: how to move columns in a dataframen in python df = df[['column1', 'column2','column3']]