-
Notifications
You must be signed in to change notification settings - Fork 159
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
Can't convert string categoricals #963
Comments
Just spotted #679, happy to close this issue here if |
This issue has been automatically marked as stale because it has not had recent activity. |
Yeah, should be a duplicate of #679, but I added a comment there to clarify |
@ngvananh2508 your error message mentions
Hope that works! |
Thank you so much! It worked already. |
Hi Isaac,
This issue is related to #726 and others dealing with implicit conversion during writing.
AnnData.write()
(toh5ad
) fails if acategorical
column inobs
orvar
has categories of typestring
(note: notstr
).Identifying the offending
pd.Series
and converting it, e.g. by doingadata.obs["col"].astype(str).astype("category")
fixes the problem.Reproducible example:
Versions:
anndata
: 0.8.0h5py
: 3.7.0Traceback
The text was updated successfully, but these errors were encountered: