numpy.irr(values)
[source]
Return the Internal Rate of Return (IRR).
This is the “average” periodically compounded rate of return that gives a net present value of 0.0; for a more complete explanation, see Notes below.
decimal.Decimal
type is not supported.
Parameters: 


Returns: 

The IRR is perhaps best understood through an example (illustrated using np.irr in the Examples section below). Suppose one invests 100 units and then makes the following withdrawals at regular (fixed) intervals: 39, 59, 55, 20. Assuming the ending value is 0, one’s 100 unit investment yields 173 units; however, due to the combination of compounding and the periodic withdrawals, the “average” rate of return is neither simply 0.73/4 nor (1.73)^0.251. Rather, it is the solution (for ) of the equation:
In general, for values
, irr is the solution of the equation: [G]
[G]  L. J. Gitman, “Principles of Managerial Finance, Brief,” 3rd ed., AddisonWesley, 2003, pg. 348. 
>>> round(np.irr([100, 39, 59, 55, 20]), 5) 0.28095 >>> round(np.irr([100, 0, 0, 74]), 5) 0.0955 >>> round(np.irr([100, 100, 0, 7]), 5) 0.0833 >>> round(np.irr([100, 100, 0, 7]), 5) 0.06206 >>> round(np.irr([5, 10.5, 1, 8, 1]), 5) 0.0886
(Compare with the Example given for numpy.lib.financial.npv)
© 2005–2019 NumPy Developers
Licensed under the 3clause BSD License.
https://docs.scipy.org/doc/numpy1.17.0/reference/generated/numpy.irr.html