1. Home
  2. Data Science
  3. NumPy
  4. Which function is used to calculate the element-wise…

Added 24 Feb 2024

Which function is used to calculate the element-wise remainder of division in NumPy?

  1. np.mod()
  2. np.remainder() Correct answer
  3. np.divide()
  4. np.divmod()

Correct answer

B. np.remainder()

17 views

MCQSEXAM

Explanation

np.remainder() returns the element-wise remainder of division; the result takes the sign of the divisor, like Python's % operator.

np.mod() is an alias for the same function. np.divmod() returns quotient and remainder together, and np.divide() performs true division.

Practise more Data Science MCQs with answers and explanations on MCQsExam.com.

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