polars.Series.shuffle#

Series.shuffle(seed: Optional[int] = None) Series[source]#

Shuffle the contents of this Series.

Parameters:
seed

Seed for the random number generator.

Examples

>>> s = pl.Series("a", [1, 2, 3])
>>> s.shuffle(seed=1)
shape: (3,)
Series: 'a' [i64]
[
        2
        1
        3
]