diff --git a/py-polars/polars/series/binary.py b/py-polars/polars/series/binary.py index ad7ea1f4823c..9d9a4eb1955c 100644 --- a/py-polars/polars/series/binary.py +++ b/py-polars/polars/series/binary.py @@ -20,7 +20,7 @@ def __init__(self, series: Series): self._s: PySeries = series._s def contains(self, literal: IntoExpr) -> Series: - """ + r""" Check if binaries in Series contain a binary substring. Parameters @@ -32,6 +32,18 @@ def contains(self, literal: IntoExpr) -> Series: ------- Series Series of data type :class:`Boolean`. + + Examples + -------- + >>> s = pl.Series("colors", [b"\x00\x00\x00", b"\xff\xff\x00", b"\x00\x00\xff"]) + >>> s.bin.contains(b"\xff") + shape: (3,) + Series: 'colors' [bool] + [ + false + true + true + ] """ def ends_with(self, suffix: IntoExpr) -> Series: