Advertisement
g96

Untitled

g96
Feb 18th, 2022
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.82 KB | None | 0 0
  1. df_1.to_csv(directory + '1.csv', index=False, header= True)
  2.  
  3. df=pd.read_csv(os.path.join(directory,'1.csv'))
  4.  
  5. df[['Order Qty (SL)','Confirmed Qty (SL)','Unconfirmed Qty (SL)','Cancelled Qty (SL)','Open Qty (SL)','Reserved Qty (SL)',
  6.  
  7.     'Fixed Qty (SL)','% Allocation (SL)','Delivered Qty (SL)','PGI Qty (SL)','Invoiced Qty (SL)',
  8.     'Net Unit Price','Confirmed Net Value (SL)','Dollars Shipped (SL)','% Shipped/Allocated (SL)']] =[['Order Qty (SL)','Confirmed Qty (SL)','Unconfirmed Qty (SL)',
  9.                                                                                                                        'Cancelled Qty (SL)','Open Qty (SL)','Reserved Qty (SL)',
  10.  
  11.     'Fixed Qty (SL)','% Allocation (SL)','Delivered Qty (SL)','PGI Qty (SL)','Invoiced Qty (SL)',
  12.     'Net Unit Price','Confirmed Net Value (SL)','Dollars Shipped (SL)','% Shipped/Allocated (SL)']].apply(pd.to_numeric,axis=1)
  13.  
  14. df[['Order Qty (SL)','Confirmed Qty (SL)','Unconfirmed Qty (SL)','Cancelled Qty (SL)','Open Qty (SL)','Reserved Qty (SL)',
  15.  
  16.     'Fixed Qty (SL)','% Allocation (SL)','Delivered Qty (SL)','PGI Qty (SL)','Invoiced Qty (SL)',
  17.     'Net Unit Price','Confirmed Net Value (SL)','Dollars Shipped (SL)','% Shipped/Allocated (SL)']] /= 1000
  18.  
  19. print(df.head())
  20.  
  21.  
  22. traceback:
  23.  
  24. sys:1: DtypeWarning: Columns (32) have mixed types.Specify dtype option on import or set low_memory=False.
  25. Traceback (most recent call last):
  26.   File "C:\Users\Digital Wholesale - Documents\2. Amazon\Customer Operations_OTC\02. Amazon weekly Report\Amazon weekly automation (Giorgi)\VL.py", line 29, in <module>
  27.     'Net Unit Price','Confirmed Net Value (SL)','Dollars Shipped (SL)','% Shipped/Allocated (SL)']] =[['Order Qty (SL)','Confirmed Qty (SL)','Unconfirmed Qty (SL)',
  28. AttributeError: 'list' object has no attribute 'apply'
  29.  
  30. Process finished with exit code 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement