Skip to content

Commit

Permalink
feat: rename shuffle to shuffle_rows (#125)
Browse files Browse the repository at this point in the history
### Summary of Changes

To be consistent with the other methods of `Table`, I've rename
`shuffle` to `shuffle_rows`. This makes it obvious that the columns are
not changed.
  • Loading branch information
lars-reimann authored Mar 30, 2023
1 parent 98d76a4 commit ea21928
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/safeds/data/tabular/containers/_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -769,7 +769,7 @@ def replace_column(self, old_column_name: str, new_column: Column) -> Table:
result[new_column.name] = new_column._data
return Table(result)

def shuffle(self) -> Table:
def shuffle_rows(self) -> Table:
"""
Shuffle the table randomly.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from safeds.data.tabular.containers import Table


def test_shuffle_valid() -> None:
def test_shuffle_rows_valid() -> None:
table = Table(pd.DataFrame(data={"col1": [1], "col2": [1]}))
result_table = table.shuffle()
result_table = table.shuffle_rows()
assert table == result_table

0 comments on commit ea21928

Please sign in to comment.