You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When calling ep.df_to_anndata(...) the binary columns (columns with only two values like 1,0) do not get correctly assigned to "numerical_columns" in uns.
To Reproduce
Example:
df = pd.DataFrame({"Col1":[i for i in range(4)], "Col2":["str" + str(i) for i in range(4)], "Col3":[1.0,0.0,np.nan,1.0]})
adata = ep.ad.df_to_anndata(df)
print(adata.uns)
# OverloadedDict, wrapping:
# OrderedDict([('numerical_columns', ['Col1']), ('non_numerical_columns', ['Col3', 'Col2'])])
# With overloaded keys:
# ['neighbors'].
Col3 should be numerical!
Expected behavior
The binary columns with numerical values such as only 0 and 1 should be assigned to numerical columns.
The bug is caused by the following line:
Describe the bug
When calling
ep.df_to_anndata(...)
the binary columns (columns with only two values like 1,0) do not get correctly assigned to "numerical_columns" inuns
.To Reproduce
Example:
Col3
should be numerical!Expected behavior
The binary columns with numerical values such as only 0 and 1 should be assigned to numerical columns.
The bug is caused by the following line:
ehrapy/ehrapy/anndata/anndata_ext.py
Line 71 in e1515b0
The XOR excludes the binary columns since they are in both sets. This should be fixed.
System [please complete the following information]:
The text was updated successfully, but these errors were encountered: