Advertisement
g96

Untitled

g96
Feb 10th, 2022
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.74 KB | None | 0 0
  1. import pandas as pd
  2. import numpy as np
  3. import os as os
  4.  
  5.  
  6.  
  7. # Get the user
  8. username = os.getlogin()
  9.  
  10.  
  11. # search for directory
  12. directory = r'C:/Users/' + username + '/Digital Wholesale - Documents/2. Amazon/Customer Operations_OTC/02. Amazon weekly Report/Amazon weekly automation/'
  13.  
  14.  
  15. # reading SAP extract  files from Run_report.xlsm and creating csv from it
  16.  
  17. df_1 = pd.read_excel(os.path.join(directory,'Run_report.xlsm'), sheet_name= "weekly",header= None)
  18. df_1 = df_1.drop(df_1.columns[[0,1]], axis=1)
  19. df_1.columns = df_1.loc[3].rename(None)
  20. df_1 = df_1.drop(range(5))
  21.  
  22. df_1.to_csv(directory + '1.csv', index=False, header= True)
  23.  
  24.  
  25. #Read CSV of SAP extract
  26.  
  27. df_weekly=pd.read_csv(os.path.join(directory,'1.csv'), low_memory=False)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement