Skip to content

Commit

Permalink
feat(python)!: Change Series.shuffle default behaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
stinodego committed Jan 2, 2023
1 parent db0c741 commit b94282b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
2 changes: 1 addition & 1 deletion py-polars/polars/internals/expr/expr.py
Original file line number Diff line number Diff line change
Expand Up @@ -5271,7 +5271,7 @@ def reshape(self, dims: tuple[int, ...]) -> Expr:

def shuffle(self, seed: int | None = None) -> Expr:
"""
Shuffle the contents of this expr.
Shuffle the contents of this expression.
Parameters
----------
Expand Down
13 changes: 2 additions & 11 deletions py-polars/polars/internals/series/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
Union,
overload,
)
from warnings import warn

from polars import internals as pli
from polars.datatypes import (
Expand Down Expand Up @@ -4566,7 +4565,8 @@ def shuffle(self, seed: int | None = None) -> Series:
Parameters
----------
seed
Seed for the random number generator.
Seed for the random number generator. If set to None (default), a random
seed is generated using the ``random`` module.
Examples
--------
Expand All @@ -4581,15 +4581,6 @@ def shuffle(self, seed: int | None = None) -> Series:
]
"""
if seed is None:
warn(
"Series.shuffle will default to a random seed in a future version."
" Provide a value for the seed argument to silence this warning.",
DeprecationWarning,
stacklevel=2,
)
seed = 0
return self.to_frame().select(pli.col(self.name).shuffle(seed)).to_series()

def ewm_mean(
self,
Expand Down

0 comments on commit b94282b

Please sign in to comment.