04pallav
9/11/2017 - 10:18 PM

Bring columns to front of dataframe

Bring columns to front of dataframe

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]