geost.base.LayeredData.slice_by_values#

LayeredData.slice_by_values(column: str, selection_values: str | Iterable, invert: bool = False)[source]#

Slice rows from data based on matching condition. E.g. only return rows with a certain lithology in the collection object.

Parameters:
  • column (str) – Name of column that contains categorical data to use when looking for values.

  • selection_values (str | Iterable) – Values to look for in the column.

  • invert (bool, optional) – If True, invert the slicing action, so remove layers with selected values instead of keeping them. The default is False.

Returns:

New instance containing only the data objects selected by this method.

Return type:

LayeredData

Examples

Return only rows in borehole data contain sand (“Z”) as lithology:

>>> boreholes.slice_by_values("lith", "Z")

If you want all the rows that may contain everything but sand, use the “invert” option:

>>> boreholes.slice_by_values("lith", "Z", invert=True)