The numpy-financial Python package is a collection of elementary financial functions. These functions were copied to this package from version 1.17 of NumPy.

The financial functions in NumPy are deprecated and eventually will be removed from NumPy; see NEP-32 for more information. This package is the replacement for the deprecated NumPy financial functions.


The package is available on PyPI, and may be installed with pip:

  $ pip install numpy-financial
The package requires NumPy version 1.15 or later.

Using numpy_financial

The importable name of the package is numpy_financial. The recommended alias is npf. For example,

>>> import numpy_financial as npf
>>> npf.irr([-250000, 100000, 150000, 200000, 250000, 300000])

Switching from numpy to numpy_financial