Python | Numpy matrix.cumprod() Last Updated : 12 Apr, 2019 Summarize Comments Improve Suggest changes Share Like Article Like Report With the help of Numpy matrix.cumprod() method, we are able to find a cumulative product of a given matrix and gives output as one dimensional matrix. Syntax : matrix.cumprod() Return : Return cumulative product of matrix Example #1 : In this example we can see that with the help of matrix.cumprod() method we are able to find the cumulative product of a given matrix. Python3 1== # import the important module in python import numpy as np # make matrix with numpy gfg = np.matrix('[6, 2, 3]') # applying matrix.cumprod() method geeks = gfg.cumprod() print(geeks) Output: [[ 6 12 36]] Example #2 : Python3 1== # import the important module in python import numpy as np # make a matrix with numpy gfg = np.matrix('[1, 2, 3; 4, 5, 6]') # applying matrix.cumprod() method geeks = gfg.cumprod() print(geeks) Output: [[ 1 2 6 24 120 720]] Comment More infoAdvertise with us Next Article numpy.nancumprod() in Python J jitender_1998 Follow Improve Article Tags : Python Python-numpy Python numpy-Matrix Function Practice Tags : python Similar Reads numpy.cumprod() in Python numpy.cumprod() function is used when we want to compute the cumulative product of array elements over a given axis. Syntax : numpy.cumprod(arr, axis=None, dtype=None, out=None) Parameters : arr : [array_like] Array containing numbers whose cumulative product is desired. If arr is not an array, a co 2 min read numpy.matrix() in Python This class returns a matrix from a string of data or array-like object. Matrix obtained is a specialised 2D array. Syntax : numpy.matrix(data, dtype = None) : Parameters : data : data needs to be array-like or string dtype : Data type of returned array. Returns : data interpreted as a matrix Python 1 min read numpy.nancumprod() in Python numpy.nancumprod() function is used when we want to compute the cumulative product of array elements over a given axis treating Not a Numbers (NaNs) as one. The cumulative product does not change when NaNs are encountered and leading NaNs are replaced by ones. Ones are returned for slices that are a 3 min read numpy.asmatrix() in Python numpy.asmatrix(data, dtype = None) Returns a matrix by interpreting the input as a matrix. Parameters : data : array-like input data dtype : Data type of returned array Returns : Interprets the input as a matrix Python # Python Programming illustrating # numpy.asmatrix import numpy as geek # array-l 1 min read numpy.cumsum() in Python numpy.cumsum() function is used to compute the cumulative sum of elements in an array. Cumulative sum refers to a sequence where each element is the sum of all previous elements plus itself. For example, given an array [1, 2, 3, 4, 5], the cumulative sum would be [1, 3, 6, 10, 15]. Let's implement t 3 min read Numpy recarray.cumprod() function | Python In numpy, arrays may have a data-types containing fields, analogous to columns in a spreadsheet. An example is [(a, int), (b, float)], where each entry in the array is a pair of (int, float). Normally, these attributes are accessed using dictionary lookups such as arr['a'] and arr['b']. Record array 2 min read Like