Data Cleaning Exercises

Glossary

Cardinality

How many rows on one side of a relationship match rows on the other: one-to-one, one-to-many or many-to-many.

State the expected cardinality before a join and test it. pandas merge(validate="many_to_one") raises when the right side has duplicate keys; in SQL, count keys grouped by the join column first.

Related: Join fan-out, Composite key