Join Types
Control which rows are kept when merging with the how parameter.
Inner Join (Default)
Keep only rows that match in both DataFrames:
Loading Pandas Playground...
Left Join
Keep all rows from left, match from right:
Loading Pandas Playground...
Right Join
Keep all rows from right, match from left:
Loading Pandas Playground...
Outer Join
Keep all rows from both DataFrames:
Loading Pandas Playground...
Comparison of All Join Types
Loading Pandas Playground...
Cross Join
Every row paired with every other row:
Loading Pandas Playground...
Exercise: Left Join
Loading Exercise...
Exercise: Outer Join
Loading Exercise...
Key Points
how='inner'- only matching rows (default)how='left'- all from left, matching from righthow='right'- all from right, matching from lefthow='outer'- all rows from bothhow='cross'- all combinations (cartesian product)- Unmatched values become NaN

