Skip to content

Commit

Permalink
Use observed=False
Browse files Browse the repository at this point in the history
  • Loading branch information
michalk8 committed Sep 15, 2024
1 parent 8ef9dec commit ba38dd7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/cellrank/estimators/terminal_states/_gpcca.py
Original file line number Diff line number Diff line change
Expand Up @@ -1051,7 +1051,7 @@ def plot_macrostate_composition(
mask = ~macrostates.isnull()
df = (
pd.DataFrame({"macrostates": macrostates, key: self.adata.obs[key]})[mask]
.groupby([key, "macrostates"], observed=True)
.groupby([key, "macrostates"], observed=False)
.size()
)
try:
Expand Down
2 changes: 1 addition & 1 deletion src/cellrank/kernels/utils/_tmat_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def cluster_helper(t1: Numeric_t, t2: Numeric_t) -> pd.DataFrame:
subset, row_cls, col_cls = self._get_time_subset(t1, t2, cluster=cluster)

df = pd.DataFrame(subset.toarray() if sp.issparse(subset) else subset).sum(0)
df = df.groupby(col_cls, observed=True).sum()
df = df.groupby(col_cls, observed=False).sum()
df = pd.DataFrame([df], index=[cluster], columns=df.index)

res = pd.DataFrame(np.zeros((1, n)), index=[cluster], columns=categories)
Expand Down

0 comments on commit ba38dd7

Please sign in to comment.