Advertisement
g96

Untitled

g96
Feb 18th, 2022
1,604
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PyCon 1.85 KB | None | 0 0
  1. df=pd.read_csv(os.path.join(directory,'1.csv'),low_memory=False)
  2.  
  3. df[['Order Qty (SL)','Confirmed Qty (SL)','Unconfirmed Qty (SL)','Cancelled Qty (SL)','Open Qty (SL)','Reserved Qty (SL)',
  4.  
  5.     'Fixed Qty (SL)','% Allocation (SL)','Delivered Qty (SL)','PGI Qty (SL)','Invoiced Qty (SL)',
  6.     'Net Unit Price','Confirmed Net Value (SL)','Dollars Shipped (SL)','% Shipped/Allocated (SL)']] = pd.to_numeric(df[['Order Qty (SL)','Confirmed Qty (SL)','Unconfirmed Qty (SL)',
  7.                                                                                                                        'Cancelled Qty (SL)','Open Qty (SL)','Reserved Qty (SL)',
  8.  
  9.     'Fixed Qty (SL)','% Allocation (SL)','Delivered Qty (SL)','PGI Qty (SL)','Invoiced Qty (SL)',
  10.     'Net Unit Price','Confirmed Net Value (SL)','Dollars Shipped (SL)','% Shipped/Allocated (SL)']])
  11.  
  12. df[['Order Qty (SL)','Confirmed Qty (SL)','Unconfirmed Qty (SL)','Cancelled Qty (SL)','Open Qty (SL)','Reserved Qty (SL)',
  13.  
  14.     'Fixed Qty (SL)','% Allocation (SL)','Delivered Qty (SL)','PGI Qty (SL)','Invoiced Qty (SL)',
  15.     'Net Unit Price','Confirmed Net Value (SL)','Dollars Shipped (SL)','% Shipped/Allocated (SL)']] /= 1000
  16.  
  17. print(df.head())
  18.  
  19.  
  20.  
  21.  
  22. Traceback
  23.  
  24. Traceback (most recent call last):
  25.   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>
  26.     'Net Unit Price','Confirmed Net Value (SL)','Dollars Shipped (SL)','% Shipped/Allocated (SL)']] = pd.to_numeric(df[['Order Qty (SL)','Confirmed Qty (SL)','Unconfirmed Qty (SL)',
  27.   File "C:\Users\gobro7\AppData\Local\Programs\Python\Python39\lib\site-packages\pandas\core\tools\numeric.py", line 141, in to_numeric
  28.     raise TypeError("arg must be a list, tuple, 1-d array, or Series")
  29. TypeError: arg must be a list, tuple, 1-d array, or Series
  30.  
  31.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement