Skip to content

Commit

Permalink
feat: remove to_rows
Browse files Browse the repository at this point in the history
  • Loading branch information
lars-reimann committed May 10, 2024
1 parent 10a3f99 commit db62750
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 71 deletions.
32 changes: 0 additions & 32 deletions src/safeds/data/tabular/containers/_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -2076,38 +2076,6 @@ def to_columns(self) -> list[Column]:
"""
return [self.get_column(name) for name in self._schema.column_names]

def to_rows(self) -> list[Row]:
"""
Return a list of the rows.
Returns
-------
rows:
List of rows.
Examples
--------
>>> from safeds.data.tabular.containers import Table
>>> table = Table.from_dict({"a":[1, 2],"b":[20, 30]})
>>> table.to_rows()
[Row({
'a': 1,
'b': 20
}), Row({
'a': 2,
'b': 30
})]
"""
import pandas as pd

return [
Row._from_pandas_dataframe(
pd.DataFrame([list(series_row)], columns=self._schema.column_names),
self._schema,
)
for (_, series_row) in self._data.iterrows()
]

def to_tabular_dataset(self, target_name: str, extra_names: list[str] | None = None) -> TabularDataset:
"""
Return a new `TabularDataset` with columns marked as a target column or feature columns.
Expand Down
39 changes: 0 additions & 39 deletions tests/safeds/data/tabular/containers/_table/test_to_rows.py

This file was deleted.

0 comments on commit db62750

Please sign in to comment.