Join validation

Validating a join means checking that it has not unexpectedly duplicated or lost rows. The validate parameter (one_to_one, one_to_many, many_to_one) raises an error if the cardinality is not the expected one, and indicator=True marks the origin of each row. You also compare the number of rows before and after.

Example

a.merge(b, on='id', how='left', validate='many_to_one', indicator=True)

Related concepts

The whole glossary