1for index, row in df.iterrows():
2 print(row['c1'], row['c2'])
3
4Output:
5 10 100
6 11 110
7 12 120
1# Get rid of $ and , in the SAL-RATE, then convert it to a float
2def money_to_float(money_str):
3 return float(money_str.replace("$","").replace(",",""))
4
5df['SAL-RATE'].apply(money_to_float)
1def EOQ(D,p,ck,ch):
2 Q = math.sqrt((2*D*ck)/(ch*p))
3 return Q
4ch=0.2
5ck=5
6df['Q'] = df.apply(lambda row: EOQ(row['D'], row['p'], ck, ch), axis=1)
7df