openclean.function.value.filter module

Functions that filter values in a given list.

class openclean.function.value.filter.Filter(predicate, truth_value=True)

Bases: object

Filter values in a list based on a given predicate function.

apply(values)

FIlter values in the given list using the associated predicate. Only values for which the predicate is satisfied will be returned in the resulting list.

Calls the prepare method of an associated value function before executing the eval method on each individual value in the given list.

Parameters

values (list) – List of scalar values or tuples of scalar values.

Return type

list

openclean.function.value.filter.filter(values, predicate, truth_value=True)

Filter values in a list based on a given predicate function. Returns a new list containing only those values that satisfy the given predicate.

Parameters
  • values (list) – List of scalar values or tuples of scalar values.

  • predicate (openclean.function.value.base.ValueFunction or callable) – Callable or value function that is used to filter values in a given list.

  • truth_value (scalar, defaut=True) – Return value of the predicate that signals that the predicate is satisfied by an input value.