努比。Python中的fv()

努比。fv(费率、净现值、pmt、pv、时间=‘结束’): 此财务功能帮助用户计算未来价值。

null

参数:

费率: [标量或(M,)数组]每段时间的小数利率(非百分比) nper: [标量或(M,)数组]总复利周期 pmt: [标量或(M,)数组]固定支付 pv: [标量或(M,)数组]当前值 什么时候: 在每个周期的开始(当={‘begin’,1})或结束(当={‘end’,0})时。默认值为{end’,0}

返回:

value at the end of nper periods

正在求解的方程:

fv + pv*(1+rate)**nper +
pmt*(1 + rate*when)/rate*((1 + rate)**nper - 1) == 0

当速率==0时

fv + pv + pmt * nper == 0

代码1:工作

# Python program explaining fv() function
import numpy as np
'''
Question :
Future value after 10 years of saving $100 now,
with an additional monthly savings of $100.
Assume the interest rate is 5% (annually)
compounded monthly ?
'''
#                 rate       np      pmt    pv
Solution = np.fv( 0.05 / 12 , 10 * 12 , - 100 , - 100 )
print ( "Solution : " , Solution)


输出:

Solution :  15692.9288943

参考资料: https://docs.scipy.org/doc/numpy-1.13.0/reference/generated/numpy.fv.html#numpy.fv .

© 版权声明
THE END
喜欢就支持一下吧
点赞7 分享