1. Home
  2. Data Science
  3. NumPy
  4. Which function is used to calculate the cumulative sum of…

Added 25 Feb 2024

Which function is used to calculate the cumulative sum of elements along a specified axis in NumPy?

  1. np.sum()
  2. np.cumsum() Correct answer
  3. np.mean()
  4. np.max()

Correct answer

B. np.cumsum()

14 views

MCQSEXAM

Explanation

The np.cumsum() function computes the cumulative sum of elements along a specified axis. It is particularly useful when you need to analyze the cumulative effect of incremental changes in data over time or across dimensions.

Reference

https://www.w3schools.com/python/numpy/default.asp

Doubts & discussion

Not sure why the answer is B? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More NumPy MCQs

Practise all NumPy MCQs

Similar MCQs