Skip to content

featurebyte.Feature.isin

isin(
other: Union[FrozenSeries, Sequence[Union[StrictInt, StrictFloat, StrictStr, bool]]]
) -> FrozenSeriesT

Description

Identifies if each element is contained in a sequence of values represented by the other parameter.

Parameters

  • other: Union[FrozenSeries, Sequence[Union[StrictInt, StrictFloat, StrictStr, bool]]]
    The sequence of values to check for membership. other can be a predefined list of values, or a Cross Aggregate feature. If other is a Cross Aggregate feature, the keys of the Cross Aggregate feature will be used to check for membership.

Returns

  • FrozenSeriesT
    Feature with boolean values

Examples

Create a new feature that checks whether a lookup feature is contained in the keys of a dictionary feature:

>>> lookup_feature = catalog.get_feature("ProductGroupLookup")
>>> dictionary_feature = catalog.get_feature("CustomerProductGroupCounts_7d")
>>> new_feature = lookup_feature.isin(dictionary_feature)
>>> new_feature.name = "CustomerHasProductGroup_7d"