pydpeet.filter_df#
- pydpeet.filter_df(df_segments_and_sequences, df_primitives, rules, standard_columns, combine_op='xor')[source]#
Filter the segments and sequences DataFrames and create separate standard and non-standard DataFrames.
- Args:
df_segments_and_sequences (pd.DataFrame): DataFrame containing segments and sequences data. df_primitives (pd.DataFrame): DataFrame containing primitive data. rules (list[str]): List of column names to filter on. standard_columns (list[str]): List of column names to be included in the standard DataFrame. combine_op (str): Combine operation (“and”, “or”, “xor”, “not”) to use for filtering. Default is “xor”.
- Returns:
tuple[pd.DataFrame, pd.DataFrame]: Filtered DataFrame and filtered IDs.
- Raises:
ValueError: If combine_op is not one of the supported operations. KeyError: If a rule column is not present in df_segments_and_sequences.