I would like to ask you to help me find a solution.
I would like to use something like df.groupby('Client') and apply to it custom function that calculates Present Value of all cash flows for each client. The method of calculation PV for different discount rates is mentioned in excel formula on attached image. The problem is that Discount rate and payments aren't constant.
Can you plase help?
Here comes the DataFrame:
pd.DataFrame([
['Ann',1,100,0.05],
['Ann',2,200,0.06],
['Ann',3,100,0.07],
['Tamara',1,300,0.05],
['Tamara',2,100,0.08],
['Tamara',3,200,0.09]],columns=['Client','Period','Payment','Discount rate'])
