Skip to content

featurebyte.Feature.str.contains

contains(
pat: str,
case: bool=True
) -> Feature

Description

Checks whether each string element contains the provided substring pattern.

Parameters

  • pat: str
    Substring pattern.

  • case: bool
    default: True
    Whether the check is case-sensitive.

Returns

  • Feature
    A new Feature object.

Examples

Check whether the ProductGroupLookup feature contains "x64":

>>> feature = catalog.get_feature("ProductGroupLookup")
>>> feature_group = fb.FeatureGroup([feature])
>>> feature_group["ProductGroup_x64"] = feature.str.contains("x64")