acidplyr.left_join¶
- acidplyr.left_join(x: DataFrame, y: DataFrame, by: str | list[str]) DataFrame¶
Left join: return all rows from x, matching rows from y.
Guarantees exactly
len(x)output rows by tracking x row positions through the merge — matches R’s index-based reconstruction.- Parameters:
- Returns:
All rows from
x, with matching columns fromywhere available (NaNotherwise).- Return type:
pd.DataFrame
Examples
>>> import pandas as pd >>> x = pd.DataFrame({"name": ["Mick", "John", "Paul"]}) >>> y = pd.DataFrame( ... {"name": ["John", "Paul"], "plays": ["guitar", "bass"]} ... ) >>> left_join(x, y, by="name")["name"].tolist() ['Mick', 'John', 'Paul']