numpy.nper() in Python Last Updated : 28 Nov, 2018 Summarize Comments Improve Suggest changes Share Like Article Like Report numpy.pmt(rate, pmt, pv, fv, when = ‘end’) : This financial function helps user to compute number of periodic payments. Parameters : rate : [scalar or (M, )array] Rate of interest as decimal (not per cent) per period pmt : [scalar or (M, )array] Payment value fv : [scalar or (M, )array] Future value pv : [scalar or (M, )array] present value when : at the beginning (when = {‘begin’, 1}) or the end (when = {‘end’, 0}) of each period. Default is {‘end’, 0}. Return : Number of periodic payments. Equation being solved : fv + pv*(1+rate)**nper + pmt*(1 + rate*when)/rate*((1 + rate)**nper - 1) == 0 or when rate == 0 fv + pv + pmt * nper == 0 Code: Python3 1== # Python program explaining # pmt() function import numpy as np ''' Question : how much time would it take to pay-off a loan of $10, 000 at 10 % annual rate of interest, if we had $100 to pay each month ? ''' # rate pmt pv Solution = np.nper(0.1 / 12, -100, 10000) # Here fv = 0 ; Also Default value of fv = 0 print("Solution - No. of periods : % f months" %(Solution)) Output: Solution - No. of periods : 215.905777 months Comment More infoAdvertise with us Next Article numpy.nper() in Python M mohit gupta_omg :) Follow Improve Article Tags : Python Python-numpy Python numpy-Financial Functions Practice Tags : python Similar Reads numpy.nonzero() in Python numpy.nonzero() function returns the indices of the elements in an array that are non-zero. It is commonly used to find the positions of non-zero (or True) elements in arrays.Example:Pythonimport numpy as np a = np.array([0, 2, 0, 3, 0, 4]) res = np.nonzero(a) print(res)Output(array([1, 3, 5]),) Exp 2 min read numpy.nanprod() in Python numpy.nanprod() function computes the product of array elements over a given axis while treating NaN (Not a Number) values as 1 (i.e., ignoring them in the product). Example:Pythonimport numpy as np a = np.array([1.0, 2.0, np.nan, 4.0]) res = np.nanprod(a) print(res)Output8.0 Explanation: np.nanprod 2 min read numpy.isnan() in Python The numpy.isnan() function tests element-wise whether it is NaN or not and returns the result as a boolean array. Syntax :Â numpy.isnan(array [, out]) Parameters :Â array : [array_like]Input array or object whose elements, we need to test for infinity out : [ndarray, optional]Output array placed wit 2 min read numpy.any() in Python The numpy.any() function tests whether any array elements along the mentioned axis evaluate to True. Syntax :Â numpy.any(a, axis = None, out = None, keepdims = class numpy._globals._NoValue at 0x40ba726c) Parameters :Â array :[array_like]Input array or object whose elements, we need to test. axis : 3 min read numpy.nansum() in Python numpy.nansum() function computes the sum of array elements over a given axis, treating NaN (Not a Number) values as zero. This is useful when you want to ignore missing or undefined values in your computation. For Example:Pythonimport numpy as np a = np.array([1.0, 2.0, np.nan, 4.0]) res = np.nansum 2 min read Like