Open emdann opened 1 year ago
thanks @emdann , i had this error today for the first time. I've used this milopy function in another conda env with no issues. is it something to do with pandas 2 (which was installed in the new env) that is causing this to be flagged as an error now?
and, for me unfortuantely the 'quick fix' code gave me:
---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
Cell In[37], line 1
----> 1 adata.obsm[adata.uns['neighbors']['use_rep']] = adata.obsm[adata.uns['neighbors']['use_rep']].values.copy()
KeyError: 'use_rep'
I inspected adata.uns['neighbors']
:
adata.uns['neighbors']
{'connectivities_key': 'connectivities',
'distances_key': 'distances',
'params': {'n_neighbors': 15,
'method': 'umap',
'random_state': 0,
'metric': 'euclidean',
'use_rep': 'X_scArches'}}
Anyway, this line of code did work for me as a quick fix adata.obsm[adata.uns['neighbors']['params']['use_rep']] = adata.obsm[adata.uns['neighbors']['params']['use_rep']].values.copy()
The error:
The quick fix:
Solution: convert
X_dimred
to array if it's a DataFrame