diff --git a/src/biocframe/BiocFrame.py b/src/biocframe/BiocFrame.py index ea91e65..4e8695e 100644 --- a/src/biocframe/BiocFrame.py +++ b/src/biocframe/BiocFrame.py @@ -347,7 +347,7 @@ def column(self, index_or_name: Union[str, int]) -> Any: "`index_or_name` must be either an integer index or column name." ) - return self[:, index_or_name] + return self[None, index_or_name] def row(self, index_or_name: Union[str, int]) -> dict: """Access a row by integer position or row name. @@ -374,7 +374,7 @@ def row(self, index_or_name: Union[str, int]) -> dict: "`index_or_name` must be either an integer index or row name." ) - return self[index_or_name, :] + return self[index_or_name, None] def _slice( self, diff --git a/tests/test_initialize.py b/tests/test_initialize.py index 3c9c5d4..c4a30bc 100644 --- a/tests/test_initialize.py +++ b/tests/test_initialize.py @@ -109,3 +109,9 @@ def test_nested_biocFrame(): bframe = BiocFrame(obj) assert bframe is not None + + nested_col = bframe.column("nested") + assert nested_col is not None + assert isinstance(nested_col, BiocFrame) + assert nested_col.row_names is None + assert len(nested_col.column_names) == 3