我想请你帮我找到一个解决办法。
我想使用类似df.groupby('Client ')的东西,并将其应用于计算每个客户所有现金流现值的自定义函数。在所附图像的Excel公式中提到了计算不同折扣率的PV的方法。问题是折扣率和付款不是恒定的。
你能帮帮忙吗?
下面是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'])
1条答案
按热度按时间2ic8powd1#