liveBook · Manning

Causation

As explained in Pandas Workout: 200 exercises to make you a stronger data analyst

Causation is a relationship in which a change in one factor produces a change in another factor.

Causation describes a relationship in which changing one factor produces a change in another. Data analysis often tests apparent relationships, but co-movement alone does not establish causation. section 11.12

Correlation is not causation

Electricity use and an electric bill are positively correlated because greater consumption accompanies a higher bill. Income and private-jet ownership may also move together, but the observed relationship alone does not prove that one measurement causes the other. Use scatter plots and correlation calculations to inspect patterns, then treat causal claims separately. section 11.12

df.corr()

Calculate pairwise correlation to describe co-movement; do not interpret the resulting value as proof of a causal relationship. section 11.12

How Pandas Workout: 200 exercises to make you a stronger data analyst covers it

How deep it goes
Contrasts correlation with causation through informal examples, but stops before formal causal analysis.
Examples
Uses electricity bills, private-jet ownership, taxi measurements, and temperature scatter plots as relationship examples.
What you can do after
Evaluate/understand why co-movement between measurements does not by itself establish that one produces the other.
How it connects
Ties causation to correlation, positive correlation, negative correlation, and scatter plots.

Also explained in

Compare how 8 books explain causation →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Pandas Workout: 200 exercises to make you a stronger data analyst. The section links point to the parts of the book it draws on.