Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- df_1 = pd.read_excel(os.path.join(directory,'copy.xlsm'), sheet_name= "weekly",header= None)
- df_1 = df_1.drop(df_1.columns[[0,1]], axis=1)
- df_1.columns = df_1.loc[3].rename(None)
- df_1 = df_1.drop(range(5))
- df_1.to_csv(directory + '1.csv', index=False, header= True)
- df=pd.read_csv(os.path.join(directory,'1.csv'))
- cols =['Order Qty (SL)','Confirmed Qty (SL)','Unconfirmed Qty (SL)','Cancelled Qty (SL)','Open Qty (SL)','Reserved Qty (SL)',
- 'Fixed Qty (SL)','% Allocation (SL)','Delivered Qty (SL)','PGI Qty (SL)','Invoiced Qty (SL)',
- 'Net Unit Price','Confirmed Net Value (SL)','Dollars Shipped (SL)','% Shipped/Allocated (SL)']
- df.loc[:len(df) - 2, cols].replace(',', '', regex=True).apply(pd.to_numeric).dtypes.unique()
- df[['Order Qty (SL)','Confirmed Qty (SL)','Unconfirmed Qty (SL)','Cancelled Qty (SL)','Open Qty (SL)','Reserved Qty (SL)',
- 'Fixed Qty (SL)','% Allocation (SL)','Delivered Qty (SL)','PGI Qty (SL)','Invoiced Qty (SL)',
- 'Net Unit Price','Confirmed Net Value (SL)','Dollars Shipped (SL)','% Shipped/Allocated (SL)']] /= 1000
- print(df.head())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement