Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(python)!: Change Series.shuffle default behaviour #5991

Merged
merged 1 commit into from
Jan 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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