Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
nguyenv committed Jul 24, 2024
1 parent b1ac482 commit c6e5db1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions python-spec/src/somacore/query/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,15 +307,15 @@ def to_anndata(
varm_layers=varm_layers,
varp_layers=varp_layers,
).to_anndata()

# Drop unused categories on axis dataframes
for name in ad.obs:
if pd.api.types.is_categorical_dtype(ad.obs[name]):
ad.obs[name] = ad.obs[name].cat.remove_unused_categories()
for name in ad.var:
if pd.api.types.is_categorical_dtype(ad.var[name]):
ad.var[name] = ad.var[name].cat.remove_unused_categories()

return ad

# Context management
Expand Down

0 comments on commit c6e5db1

Please sign in to comment.