Skip to content
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
6 changes: 3 additions & 3 deletions src/safeds/data/tabular/containers/_row.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,20 +345,20 @@ def column_names(self) -> list[str]:
return self._schema.column_names

@property
def number_of_column(self) -> int:
def number_of_columns(self) -> int:
"""
Return the number of columns in this row.

Returns
-------
number_of_column : int
number_of_columns : int
The number of columns.

Examples
--------
>>> from safeds.data.tabular.containers import Row
>>> row = Row({"a": 1, "b": 2})
>>> row.number_of_column
>>> row.number_of_columns
2
"""
return self._data.shape[1]
Expand Down
3 changes: 1 addition & 2 deletions tests/safeds/data/tabular/containers/test_row.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,6 @@ def test_should_return_same_hash_for_equal_rows(self, row1: Row, row2: Row) -> N
@pytest.mark.parametrize(
("row1", "row2"),
[

(Row({"col1": 0}), Row({"col1": 1})),
(Row({"col1": 0}), Row({"col2": 0})),
(Row({"col1": 0}), Row({"col1": "a"})),
Expand Down Expand Up @@ -346,7 +345,7 @@ class TestNumberOfColumns:
],
)
def test_should_return_the_number_of_columns(self, row: Row, expected: int) -> None:
assert row.number_of_column == expected
assert row.number_of_columns == expected


class TestGetValue:
Expand Down