Skip to content

Instantly share code, notes, and snippets.

@KevinGutowski
Created January 7, 2022 21:17
Show Gist options
  • Save KevinGutowski/e8a3059a30cfc38dbc7b959d5bdbdc09 to your computer and use it in GitHub Desktop.
Save KevinGutowski/e8a3059a30cfc38dbc7b959d5bdbdc09 to your computer and use it in GitHub Desktop.
Reorder pandas column using indexes
columns = list(df.columns)
df = df[[columns[i] for i in [3,2,1,4,6,4,8]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment