Which of the following methods is used to calculate the dot product of two arrays in NumPy?
Correct answer
A. np.dot()
13 views
A. np.dot()
13 views
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.
Not sure why the answer is A? Ask here and get an explanation.