Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # create df
- df = pd.Series(data).str.split('|', expand=True).rename(columns=dict(enumerate(cols))).iloc[:-2, 1:]
- # remove leading/trailing whitespace
- df = df.apply(lambda s: s.str.strip(), axis=1)
- df.columns = df.columns.str.strip()
- columns =['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[columns]= df[columns].apply(pd.to_numeric)/1000
- print(df)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement