LECA.prep.filter_fn
- LECA.prep.filter_fn(data: DataFrame, cols: str | List[str], func: Callable[[...], bool]) Tuple[DataFrame, DataFrame]
Applies the provided function to each value in the given column(s). If the function returns true, that measurement is removed from the filtered DataFrame (and added to the caught DataFrame).
- Parameters:
data (
DataFrame) – DataFrame of experimental measurements.cols (Union[str, List[str]]) – List of columns in DataFrame to apply filter function to.
func (Callable[..., bool]) – Function taking one argument (each value in the selected columns) and returning boolean (
Trueindicating to remove value).
- Returns:
The first
DataFrameis the caught values which are removed from the secondDataFrame, which is the filtered (clean) DataFrame.- Return type:
Tuple[
DataFrame,DataFrame]