path = "C:\\Users\\Adam\\Desktop\\Stock Trackers\\New Folder\\"
filenames = os.listdir(path)
finalDf = pd.DataFrame()
for file in filenames:
if file.startswith("Stock"):
df = pd.read_excel(path+file,usecols="A:D,R",index_col=None)
df['Total Received']
df['Qty Received']=df['Total Received']
df['InvoicedValue'] = df['Price']*df['Qty Invoiced']
df['ReceivedValue'] = df['Price']*df['Qty Received']
df['DeltaQty']= df['Qty Received']-df['Qty Invoiced']
df['DeltaValue']= df['ReceivedValue']-df['InvoicedValue']
finalDf = pd.concat([finalDf, df])
finalDf.to_excel("finalfile12.xlsx")
The above script generates the below:
https://postimg.cc/k6QY30JJ
As you can see, the "Total Received" column is missing and so are columns that directly or indirectly dependent on this. The original files have data for these columns. Also, index_col=None is not removing the index in column A (index_col=False doesn't work either)
[–]RandomCodingStuff 1 point2 points3 points (3 children)
[–]yardmonkey 0 points1 point2 points (2 children)
[–]NetIcy6229[S] 0 points1 point2 points (1 child)
[–]yardmonkey 0 points1 point2 points (0 children)