1. Home
  2. Data Science
  3. NumPy
  4. What function is used to calculate the mean of an array?

Added 24 Feb 2024

What function is used to calculate the mean of an array?

  1. np.mean() Correct answer
  2. mean()
  3. Both A and B
  4. None of the above

Correct answer

A. np.mean()

13 views

MCQSEXAM

Explanation

np.mean() computes the arithmetic mean of an array, optionally along an axis: np.mean(a, axis=0).

A bare mean() is not a built-in Python function; you can, however, call the method form a.mean() on an array.

For more solved questions like this one, see Data Science MCQs on MCQsExam.com.

Doubts & discussion

Not sure why the answer is A? 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