numpy.fv () in Python



Parameters :

rate: [scalar or (M,) array] Rate of interest as decimal (not per cent) per period
nper: [scalar or (M,) array] total compounding periods
pmt: [scalar or (M,) array] fixed payment
pv: [scalar or (M,) array] present value
when: at the beginning (when = {`begin`, 1 }) or the end (when = {`end`, 0}) of each period. Default is {`end`, 0}

Return:

 value at the end of nper periods 

Solving the equation:

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

or when rate == 0

 fv + pv + pmt * nper == 0 

Code 1: Working

# Python program explaining the fv () function

 

import numpy as np

"" "
Question:

  
Future value after 10 years of savings $ 100 now,
with additional monthly savings $ 100.
Suppose the interest rate is 5% (per year)
monthly?
"" "

  
# rate np pmt pv

Solution = np .fv ( 0.05 / 12 , 10 * 12 , - 100 , - 100 )

 

print ( "Solution:" , Solution)

Output:

 Solution: 15692.9288943 

Links:
https://docs.scipy.org/doc/numpy-1.13.0/reference/generated/numpy.fv.html#numpy.fv
,