DataFrameComparison.num_rows_joined_equal#
- DataFrameComparison.num_rows_joined_equal(*subset: str) int[source]#
The number of rows that can be joined and have matching values in all columns in subset.
- Parameters:
subset – The columns to check for mismatches. If not provided, all common columns are used.
- Returns:
The number of rows that can be joined and have matching values across the specified columns.
- Raises:
ValueError – If any of the provided columns are not common columns.
Examples
>>> import polars as pl >>> from diffly import compare_frames >>> left = pl.DataFrame({"id": [1, 2, 3], "status": ["a", "b", "c"], "value": [10.0, 20.0, 30.0]}) >>> right = pl.DataFrame({"id": [1, 2, 3], "status": ["a", "x", "x"], "value": [10.0, 25.0, 30.0]}) >>> comparison = compare_frames(left, right, primary_key="id") >>> comparison.num_rows_joined_equal() 1 >>> comparison.num_rows_joined_equal("value") 2