1. Home
  2. Data Science
  3. NumPy
  4. Which of the following methods is used to calculate the…

Added 24 Feb 2024

Which of the following methods is used to calculate the dot product of two arrays in NumPy?

  1. np.dot() Correct answer
  2. np.cross()
  3. np.inner()
  4. np.outer()

Correct answer

A. np.dot()

13 views

MCQSEXAM

Explanation

np.dot() calculates the dot product of two arrays. np.cross() gives the cross product and np.outer() the outer product, while np.inner() matches dot only for 1-D arrays.

For matrix multiplication the @ operator and np.matmul() are equivalent to dot on 2-D arrays.

Practise more Data Science MCQs with answers and explanations 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