numpy.fv(rate,nper,pmt,fv,当=“结束”时):此财务函数可帮助用户计算未来价值。
参数:
-
rate : [数组]每个周期的利率为十进制(不是百分比)
nper : [数组]总复利期
pmt : [数组]固定付款
fv : [数组,可选]未来值。默认值= 0.0
when : 在每个期间的开始(当= {'开始',1}时)或结束(当= {'结束',0}时)。默认值为{‘end’,0}
返回:
present value as per given parameters.
求解方程:
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 pv() function
import numpy as np
'''
Question :
What is the present value (e.g., the initial investment)
of an investment that needs to total $15692.93 after 10
years of saving $100 every month?
Assume the interest rate is 5% (annually) compounded monthly.
'''
# rate np pmt fv
Solution = np.pv(0.05/12, 10*12, -100, 15692.93)
print("present value (fv) : ", Solution)
输出:
present value (fv) : -100.000671316
参考:
相关用法
注:本文由纯净天空筛选整理自Mohit Gupta_OMG 大神的英文原创作品 numpy.pv() in Python。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。