numpy.irr(values) : This financial function helps user to compute IRR Value i.e. Internal Rate of Return ie. “average” periodically compounded rate of return.

Parameters :
values : [array-like] Input cash flows per time period. net “deposits” are negative and net “withdrawals” are positive
Return : Internal Rate of Return for periodic input values.
Code:
# Python program explaining
# irr() function
import numpy as np
'''
Question :
Investment = 500
Withdrawals at regular interval : 50, 31, 3, 11
'''
Solution = np.irr([-500, 50, 31, 3, 11])
print("Solution - Internal Rate of Return : ", Solution)
Output:
Solution - Internal Rate of Return : -0.5296447721512683