numpy.irr() in Python (original) (raw)
Last Updated : 05 Aug, 2022
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:
Python3
import
numpy as np
Solution
=
np.irr([
-
500
,
50
,
31
,
3
,
11
])
print
(
"Solution - Internal Rate of Return : "
, Solution)
Output:
Solution - Internal Rate of Return : -0.5296447721512683
Similar Reads
- numpy.mirr() in Python numpy.mirr(values, finance_rate, reinvest_rate) : This financial function helps user to compute modified IRR Value i.e. Modified Internal Rate of Return ie. “average†periodically compounded rate of returnIRR equals to - Parameters : values : [array-like] Input cash flows per time period. net “depos 1 min read
- numpy.ipmt() in Python numpy.ipmt(rate, nper, pv, fv, when = ‘end’) : This financial function helps user to compute payment value as per the interest only. i.e. returns the interest part. Parameters : rate : [scalar or (M, )array] Rate of interest as decimal (not per cent) per period nper : [scalar or (M, )array] total co 2 min read
- numpy.find() in Python numpy.core.defchararray.find(arr, substring, start=0, end=None): Finds the lowest index of the sub-string in the specified range. Parameters: arr : array-like or string to be searched. substring : substring to search for. start, end : [int, optional] Range to search in. Returns : An integer array wi 1 min read
- numpy.index() in Python numpy.core.defchararray.index(arr, substring, start=0, end=None): Finds the lowest index of the sub-string in the specified range But if substring is not found, it raises ValueError. Parameters: arr : array-like or string to be searched. substring : substring to search for. start, end : [int, option 1 min read
- numpy.isscalar() in Python In this article, we will elucidate the `numpy.isscalar()` function through a well-documented code example and comprehensive explanation. Python numpy.isscalar() Syntax Syntax : numpy.isscalar(element) Parameters: element: The input element to be checked for scalar properties.Return Type: bool: Retur 3 min read
- Python | Numpy ndarray.__iand__() With the help of Numpy ndarray.__iand__() method, we can get the elements that is anded by the value that is provided as a parameter in numpy.ndarray.__iand__() method. Syntax: ndarray.__iand__($self, value, /) Return: self&=value Example #1 : In this example we can see that every element is and 1 min read
- numpy.alen() in Python numpy.alen() function is used to return the length of the first dimension of the input array. Syntax : numpy.alen(arr) Parameters : arr : [array_like] Input array. Return : [int]Length of the first dimension of arr. Code #1 : # Python program explaining # alen() function import numpy as geek # input 1 min read
- numpy.load() in Python numpy.load() function return the input array from a disk file with npy extension(.npy). Syntax : numpy.load(file, mmap_mode=None, allow_pickle=True, fix_imports=True, encoding='ASCII') Parameters: file : : file-like object, string, or pathlib.Path.The file to read. File-like objects must support the 2 min read
- numpy.nonzero() in Python numpy.nonzero()function is used to Compute the indices of the elements that are non-zero. It returns a tuple of arrays, one for each dimension of arr, containing the indices of the non-zero elements in that dimension. The corresponding non-zero values in the array can be obtained with arr[nonzero(ar 2 min read
- numpy.angle() in Python numpy.angle() function is used when we want to compute the angle of the complex argument. A complex number is represented by “ x + yi " where x and y are real number and i= (-1)^1/2. The angle is calculated by the formula tan-1(x/y). Syntax : numpy.angle(z, deg=0) Parameters : z : [array_like] A com 2 min read