Cleaning & transforming data

Joins, lookups & comparisons

VLOOKUP and INDEX MATCH in pandas, merging files, fuzzy matching and diffing two workbooks.

A VLOOKUP in pandas: the orders table is left-merged with the price list on the product key, so every order gains its price and unmatched keys show as missing.A VLOOKUP in pandas: the orders table is left-merged with the price list on the product key, so every order gains its price and unmatched keys show as missing.VLOOKUP is a left mergeorderssku · qty1,200 rowsmerge(how="left")on="sku"indicator=Truepricessku · price340 rows

Start with the full guides

The long-form treatment of joins, lookups & comparisons, with the reasoning the shorter pages assume.

Step-by-step how-tos

One task each, with code you can copy, run and adapt.

Follow it through a track

Prefer an ordered route? These tracks cover joins, lookups & comparisons along the way, in the order that builds on itself.

Related topics

Subjects that keep turning up on the same pages as this one, most overlap first.

Joins, lookups & comparisons is part of Cleaning & transforming data.