0

img

I have these 2 columns and I want to calculate the sum of extended cost for each specific supplier and put them in a new column, for example for the supplier No: 4343 it should take all the extended cost values that supplier 4343 has made and then put this values for this supplier in the new column.

I have done this code but did not work as I expected to have.

dflist = ['Supplier_No']
for s in dflist:
    df['result'] = df[s].sum(axis=0) 
Skully
  • 2,160
  • 3
  • 17
  • 30

0 Answers0