numpy.fv(rate,nper,pmt,pv,when ='end'):此財務函數可幫助用戶計算未來價值。
參數:
-
rate : [標量或(M,)數組]每個周期的利率為十進製(不是百分比)
nper : [標量或(M,)數組]總複利期
pmt : [標量或(M,)array]固定付款
pv : [標量或(M,)數組]現值
when : 在每個期間的開始(當= {'開始',1}時)或結束(當= {'結束',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
。
相關用法
注:本文由純淨天空篩選整理自Mohit Gupta_OMG 大神的英文原創作品 numpy.fv() in Python。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。