Rather than build a large CVS file completely by hand, I'm trying to build it with some panda magic. My current problem is that I'm trying to calculate the cost and creating 'x', and it need 'n' number of 'y' which costs 'z'
The current dataframe is structured as Item(x), Price(z), Material(y),MaterialSum(n)
The Material is within the data frame as it's own item
df['Cost'] = (df[df.Item == df['Material']].iloc[0])['Price'] * df['MaterialSum']
I've devised this code to build the cost column, however, it only uses the first row's material throughout the data frame, rather than each rows individual material column. Any tips on how to overcome it?