📜  Python中的 numpy.pv()

📅  最后修改于: 2022-05-13 01:55:37.959000             🧑  作者: Mango

Python中的 numpy.pv()

numpy.fv(rate, nper, pmt, fv, when = 'end') :此财务函数可帮助用户计算未来值。

参数 :

返回 :

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

参考 :
https://docs.scipy.org/doc/numpy-1.13.0/reference/generated/numpy.pv.html