Skip to content

Commit

Permalink
Backport PR scverse#1402: Update to_df docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
Philipp Weiler authored and meeseeksmachine committed Mar 11, 2024
1 parent 767c2be commit 51e3226
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 6 additions & 2 deletions anndata/_core/anndata.py
Original file line number Diff line number Diff line change
Expand Up @@ -1282,7 +1282,7 @@ def transpose(self) -> AnnData:

T = property(transpose)

def to_df(self, layer=None) -> pd.DataFrame:
def to_df(self, layer: str | None = None) -> pd.DataFrame:
"""\
Generate shallow :class:`~pandas.DataFrame`.
Expand All @@ -1295,8 +1295,12 @@ def to_df(self, layer=None) -> pd.DataFrame:
Params
------
layer : str
layer
Key for `.layers`.
Returns
-------
Pandas DataFrame of specified data matrix.
"""
if layer is not None:
X = self.layers[layer]
Expand Down
2 changes: 2 additions & 0 deletions docs/release-notes/0.10.6.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
```{rubric} Documentation
```

* Type hints and docstrings for `.to_df` method are updated and fixed {pr}`1402` {user}`WeilerP`

```{rubric} Performance
```

Expand Down

0 comments on commit 51e3226

Please sign in to comment.