DataFrameComparison.left_only#
- DataFrameComparison.left_only(
- *,
- lazy: Literal[True],
- DataFrameComparison.left_only(
- *,
- lazy: Literal[False] = False,
The rows in the left data frame which cannot be joined with a row in the right data frame.
- Parameters:
lazy – If
True, return a lazy frame. Otherwise, return an eager frame (default).- Returns:
A data frame or lazy frame containing the rows that are only in the left data frame.
Examples
>>> import polars as pl >>> from diffly import compare_frames >>> left = pl.DataFrame({"id": [1, 2, 3, 4], "value": [10.0, 20.0, 30.0, 40.0]}) >>> right = pl.DataFrame({"id": [1, 2, 3, 5], "value": [10.0, 25.0, 30.0, 50.0]}) >>> comparison = compare_frames(left, right, primary_key="id") >>> comparison.left_only() shape: (1, 2) ┌─────┬───────┐ │ id ┆ value │ │ --- ┆ --- │ │ i64 ┆ f64 │ ╞═════╪═══════╡ │ 4 ┆ 40.0 │ └─────┴───────┘