Skip to content

Instantly share code, notes, and snippets.

@KevinGutowski
Created January 7, 2022 21:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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