Skip to content

Commit

Permalink
Update to_df docstrings (#1402)
Browse files Browse the repository at this point in the history
* Update `to_df`

* Add typehints
* Update docstrings.

* Update `release-notes/0.10.6.md`
  • Loading branch information
WeilerP committed Mar 11, 2024
1 parent 9452dd5 commit 12878b3
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
Expand Up @@ -1284,7 +1284,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 @@ -1297,8 +1297,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
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 12878b3

Please sign in to comment.