geost.base.DiscreteData.select_by_values#
- DiscreteData.select_by_values(column: str, selection_values: str | Iterable, how: str = 'or')[source]#
Select data based on the presence of given values in a given column. Can be used for example to select boreholes that contain peat in the lithology column.
- Parameters:
column (str) – Name of column that contains categorical data to use when looking for values.
selection_values (str | Iterable) – Value or values to look for in the column.
how (str, optional) – Either “and” or “or”. “and” requires all selection values to be present in column for selection. “or” will select the core if any one of the selection_values are found in the column. Default is “and”.
- Returns:
New instance containing only the data selected by this method.
- Return type:
Examples
To select boreholes where both clay (“K”) and peat (“V”) are present at the same time, use “and” as a selection method:
>>> boreholes.select_by_values("lith", ["V", "K"], how="and")
To select boreholes that can have one, or both lithologies, use or as the selection method:
>>> boreholes.select_by_values("lith", ["V", "K"], how="and")