featurebyte.ViewColumn.isin¶
isin(
other: Union[FrozenSeries, Sequence[Union[StrictInt, StrictFloat, StrictStr, bool]]]
) -> FrozenSeriesTDescription¶
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.
Returns¶
- FrozenSeriesT
Column with boolean values
Examples¶
Check to see if the values in a series are in a list of values, and use the result to filter the original view:
>>> view = catalog.get_table("GROCERYPRODUCT").get_view()
>>> condition = view["ProductGroup"].isin(["Sauces", "Fromages", "Fruits"])
>>> view[condition].sample(5, seed=0)
GroceryProductGuid ProductGroup
0 45cd58ba-efec-463a-9107-0633168a215e Fromages
1 97e6afc9-1033-4fb3-b2a2-3d62261e1d17 Fromages
2 fb26ed22-524e-4c9e-9ea2-03c266e7f9b9 Fromages
3 a817d904-bc58-4048-978d-c13857969a69 Fruits
4 00abe6d0-e3f7-4f29-b0ab-69ea5581ab02 Sauces