neldelesndblogtagscontactresume
neldelesndblogtagscontactresume

2019 June 7thRe-arranging Columns in your Dataframepandas 

How to re-arrange the columns in your Dataframe


  1. Print out the column labels of your Dataframe print(df.columns())
  2. Copy the printed list and re-arrange as you like. Store it in a var foo. For example, my columns are: ['shipper_id',``_shipper' 'period'] and I will re-arrange it to: foo = ['shipper_id','period','shipper']
  3. Replace it in your df: df = df[foo]