Skip to content

Commit

Permalink
docs(python): Add example for Series.bin.contains (#14297)
Browse files Browse the repository at this point in the history
  • Loading branch information
mbuhidar authored Feb 6, 2024
1 parent 7070368 commit 79ffe72
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion py-polars/polars/series/binary.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down

0 comments on commit 79ffe72

Please sign in to comment.