NumPy | Python Methods and Functions

** **

** numpy.recarray.cumprod() ** returns the cumulative product of array elements along a given axis.

Syntax:`numpy.recarray.cumprod (axis = None, dtype = None, out = None)`

Parameters:

axis:Axis along which the cumulative product is computed. The default is to compute the product of the flattened array.

dtype:Type of the returned array, as well as of the accumulator in which the elements are multiplied.

out:[ndarray, optional] A location into which the result is stored.

- & gt; If provided, it must have a shape that the inputs broadcast to.

- & gt; If not provided or None, a freshly-allocated array is returned.

Return:A new array holding the result is returned unless out is specified, in which case it is returned.

** Code # 1: **

` ` |

** Output:**

Input array: [[(5., 2) (3., -4) (6., 9)] [(9., 1) (5., 4) (-12., -7)]] Record array of float: [[5. 3. 6. ] [9. 5. -12.]] Record array of int: [[2 -4 9] [1 4 -7]] Output array along axis 1: [[5. 15. 90.] [9. 45. -540.]] Output array along axis 0: [[2 -4 9] [2 -16 -63]]

Pandas for Everyone: Python Data Analysis (Addison-Wesley Data & Analytics Series), 1st Edition. Pandas for Everyone brings together the practical knowledge and insights you need to solve real-worl...

05/09/2021

IRMA is a research-based professional organization dedicated to advancing the concepts and practices of information resource management in modern organizations. The primary purpose of IRMA is to promo...

28/08/2021

Hands-On Machine Learning with Scikit-Learn, Keras, and TensorFlow: Concepts, Tools, and Techniques to Build Intelligent Systems PDF, 2nd Edition. This book assumes you know next to nothing about m...

22/08/2021

As the title promises, this book will introduce you to one of the world’s most popular programming languages: Python. It’s aimed at beginning programmers as well as more experienced programmers wh...

23/09/2020

X
# Submit new EBook