Closed rialc13 closed 6 months ago
It seems Anndata prevents saving it in the new version if the key in a dictionary has an int type. We will try to fix it soon. One temporary solution is using pickle
# For saving
import pickle
with open('anndata.obj', 'wb') as fp:
pickle.dump(data, fp)
# For loading
import pickle
with open('anndata.obj', 'rb') as fp:
adata = pickle.load(fp)
Thank you so much! This worked!
Hi,
After performing spatial trajectory analysis, I am trying to save the anndata object to h5ad file using the write_h5ad(file_name) function but am getting the following error -
I googled the error & many people suggested removing the adata.raw layer. I did that (using del bdata.raw), still I get the following (new) error -
Can you please help? Thanks