I try to modify my adata.obs according to the library_id.
I don’t understand why, there are both dataframe …
Many thanks !!!
Sophie
I try to modify my adata.obs according to the library_id.
I don’t understand why, there are both dataframe …
Many thanks !!!
Sophie
hi @sophieRAIBAUD , this is because you are assigning 1
to a view
of the anndata (the subsetted one by 132_...
). This is nothing specifically to squidpy but more generally to anndata and how views are handled in python (numpy, dataframes). In order to reproduce that behaviour correctly, I would do something like this
adata.obs["test"] = adata.obs["my_annotation"].replace({"132_...":"10", "132_1...":"1"})
HTH
great, this is working correctly !
now I want to fill the library id with different number (I have done the nuclei segmentation and got 1 nmber per raw in .obsm:
I Finally mangaged with a series of concat and merge
thanks for the advice !