geost.base.CptCollection.select_by_values#

CptCollection.select_by_values(column: str, selection_values: str | Iterable, how: str = 'or')#

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 of the current object containing only the selection resulting from application of this method. e.g. if you are calling this method from a Collection, you will get an instance of a Collection back.

Return type:

New instance of the current object.

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")