0PricingLogin
Data Science Academy · Lesson

Pearson vs Spearman

Linear versus rank relationships.

Two Ways to Correlate

Not all correlation is the same. The two most common methods, Pearson and Spearman, ask slightly different questions about how your variables relate. 🔍

What Pearson Measures

Pearson measures how well a straight line fits your data. It is the classic choice when both variables are numeric and their relationship looks roughly linear.

r = df["income"].corr(df["spending"], method="pearson")
print(round(r, 2))

All lessons in this course

  1. Correlation Is Not Causation
  2. Pearson vs Spearman
  3. Read a Correlation Heatmap
  4. Skew, Kurtosis, and Normality
← Back to Data Science Academy