came.utils.preprocess.take_1v1_matches

came.utils.preprocess.take_1v1_matches(df: DataFrame, cols: List | None = None)

Take the one-to-one matches of the given two columns of a pd.DataFrame

Parameters:
  • df – a dataframe with at least two columns

  • cols – column names of df, specifying the columns to match.

Return type:

A pd.DataFrame contains only one-to-one mappings and the corresponding rows