Skip to content

Commit

Permalink
Merge pull request #794 from scverse/Fix_var_by_distance
Browse files Browse the repository at this point in the history
Fix var_by_distance to pass test after pandas update
  • Loading branch information
LLehner committed Feb 5, 2024
2 parents 4fdb801 + cb3cbd4 commit 4ee00a7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/squidpy/tl/_var_by_distance.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,9 @@ def var_by_distance(
if isinstance(covariates, str):
covariates = [covariates]
df[covariates] = adata.obs[covariates].copy()
# match index with .obs
if isinstance(groups, list):
df = df.reindex(adata.obs.index)
if copy:
logg.info("Finish", time=start)
return df
Expand Down

0 comments on commit 4ee00a7

Please sign in to comment.