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

Added 24 Feb 2024

Which function is used to calculate the Pearson correlation coefficient in NumPy?

  1. np.correlate()
  2. np.corrcoef() Correct answer
  3. np.cov()
  4. np.corr()

Correct answer

B. np.corrcoef()

15 views

MCQSEXAM

Explanation

np.corrcoef() returns the matrix of Pearson correlation coefficients, with values between −1 and +1.

np.cov() gives covariance, np.correlate() computes signal cross-correlation, and np.corr() does not exist.

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