Advertisement
g96

Untitled

g96
Feb 23rd, 2022
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.99 KB | None | 0 0
  1. col_names_ama =['PC9','Account Seasonality']
  2. # col_names_dock = ['Materials', 'Amazon seasonality']
  3. df_ros = pd.read_excel(os.path.join(directory,'Amazon Seasonality.xlsx'),usecols=col_names_ama)
  4. df_dock =pd.read_excel(os.path.join(directory,'Dock seasonality.xlsx'))
  5. df_dock = df_dock.drop(df_dock.columns[0], axis=1)
  6.  
  7. print('1 Done')
  8.  
  9. # rename columns for pd.merge
  10. df.rename(columns={'Material': 'PC9'}, inplace=True)
  11. # df_ros.rename(columns={'Colorway Code' : 'PC9'}, inplace=True)  not applied anymore in new file
  12. df_ros.rename(columns={'Account Seasonality':'Seasonality'}, inplace=True)
  13. df.rename(columns={'Rej.Reason (SL)': 'Cancellation Code'}, inplace=True)
  14. df_dock.rename(columns={'Material': 'PC9'}, inplace =True)
  15. df_dock.rename(columns={'Amazon Seasonality':'Seasonality'}, inplace =True)
  16.  
  17. print('2 Done')
  18.  
  19. #Add columns
  20.  
  21. df_ros['Division']='10'
  22. df_dock['Division']='20'
  23. df_all = pd.concat([df_ros,df_dock])
  24.  
  25.  
  26.  
  27. df_all.to_csv(directory + "new.csv", index =False, header =True)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement