polars.Series.bin.tail#

Series.bin.tail(n: int = 5) Series[source]#

Take the last n bytes of the binary values.

Parameters:
n

Length of the slice. Negative indexing is supported; see note (2) below.

Returns:
Series

Series of data type Binary.

Notes

  1. A similar method exists for taking the first n bytes: head().

  2. If n is negative, it is interpreted as “starting at the nth byte”, e.g., tail(-3) returns all but the first three bytes.

Examples

>>> colors = pl.Series([b"\x00\x00\x00", b"\xff\xff\x00", b"\x00\x00\xff"])
>>> colors.bin.tail(2)
shape: (3,)
Series: '' [binary]
[
        b"\x00\x00"
        b"\xff\x00"
        b"\x00\xff"
]