Calculate Pearson Correlation with SciPy
📖 Scenario: You are analyzing how two sets of exam scores relate to each other. You want to find out if students who score high in one exam also score high in the other.
🎯 Goal: Calculate the Pearson correlation coefficient between two lists of exam scores using the scipy.stats library.
📋 What You'll Learn
Create two lists called
exam1_scores and exam2_scores with exact valuesImport the
pearsonr function from scipy.statsUse
pearsonr to calculate the correlation coefficient between the two listsPrint the Pearson correlation coefficient value
💡 Why This Matters
🌍 Real World
Pearson correlation is used in many fields like education, health, and business to find relationships between two variables, such as test scores or sales numbers.
💼 Career
Data scientists and analysts use Pearson correlation to explore data and find meaningful patterns that help in decision making.
Progress0 / 4 steps