Skip to content

Commit

Permalink
fixed check for categorical dtype
Browse files Browse the repository at this point in the history
  • Loading branch information
felix0097 committed Jan 25, 2022
1 parent 30655f4 commit c5e1dee
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sfaira/data/store/stores/single.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def __align_categorical_levels(adata_by_key: Dict[str, anndata.AnnData]) -> Dict
# get list of all categorical columns - using one dataset is enough as they all have the same columns
categorical_columns: List[str] = []
for col in adata_by_key[datasets[0]].obs.columns:
if adata_by_key[datasets[0]].obs[col].dtype == 'category':
if isinstance(adata_by_key[datasets[0]].obs[col].dtype, pd.api.types.CategoricalDtype):
categorical_columns.append(col)
# union categorical levels across datasets for each column
categories_columns: Dict[str, pd.Index] = {}
Expand Down

0 comments on commit c5e1dee

Please sign in to comment.