1. Home
  2. Data Science
  3. NumPy
  4. Which function is used to calculate the dot product of two…

Added 24 Feb 2024

Which function is used to calculate the dot product of two arrays?

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

Correct answer

A. np.dot()

13 views

MCQSEXAM

Explanation

np.dot() computes the dot product. For 1-D arrays it gives the inner product; for 2-D arrays it performs matrix multiplication, which can also be written with the @ operator.

np.multiply() is element-wise multiplication and np.cross() is the cross product.

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