Created
September 11, 2017 22:18
-
-
Save 04pallav/5f892c15ab567e719c1f22d7ea461d7f to your computer and use it in GitHub Desktop.
Bring columns to front of dataframe
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cols = list(df1) | |
cols.insert(0, cols.pop(cols.index('return_datetime'))) #3rd | |
cols.insert(0, cols.pop(cols.index('order_datetime'))) #2nd | |
cols.insert(0, cols.pop(cols.index('package_req_id'))) #1st | |
df1 = df1.ix[:, cols] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment