Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport PR #1402 on branch 0.10.x (Update to_df docstrings) #1406

Merged
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 6 additions & 2 deletions anndata/_core/anndata.py
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
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