What is the numpy.fv() Method

The numpy.fv() function “calculates the future value”. Future cash flows are measured at the discount rate, and the higher the discount rate, the lower the potential cash flow’s present value.

Syntax

numpy.fv(rate, nper, pmt, fv, when='end')

This function takes five arguments:

  1. rate: This decimal value indicates the interest rate per period. This can be a scalar or an array.
  2. nper: This indicates a total compounding period. This can be a scalar or an array.
  3. pmt: This parameter indicates the fixed payment. This can be a scalar or an array.
  4. fv: This parameter indicates the future value. This can be a scalar or an array. The default value is 0.0
  5. when: At the beginning (when = {‘begin’, 1}) or the end (when = {‘end’, 0}) of each period.

Return value

The NumPy fv() function returns a float type value, which indicates the Present Value after the nper period.

Example 1

import numpy as np

rate = 0.10
nper = 10 * 12
pmt = -200
fv = 1100

print("Future Value after a period of ", nper, " is :")
print(np.fv(rate, nper, pmt, fv, when='end'))

Output

Future Value after a period of 120 is:
83436161.93604787

In this example, we can see that we have initialized the values of rate, nper, pmt, and fv; we have called np.fv() to calculate the Present Value. 

We can see that, as all our given values are scalar, we got a result in scalar and float data types.

Example 2

import numpy as np

rate = np.array((.12, .30, .45))
nper = np.array((100, 120, 50))
pmt = (100, -300, -100)
fv = (-100, 50, 150)

print("Present Value after a period of ", nper, " is :")
print(np.fv(rate, nper, pmt, fv, when='end'))

Output

Present Value after a period of [100 120 50] is :
[-6.12488282e+07 4.47636903e+16 8.45416944e+09]

In this example, we initialized the values of rate, nper, pmt, and fv as array values, and then we called the np.fv() function to calculate the present value.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.