ehrapy.anndata.move_to_x¶
- ehrapy.anndata.move_to_x(adata, to_x)[source]¶
Move features from obs to X inplace.
- Parameters:
- Return type:
- Returns:
A new AnnData object with moved columns from obs to X. This should not be used for datetime columns currently.
Examples
>>> import ehrapy as ep >>> adata = ep.dt.mimic_2(encoded=True) >>> ep.ad.move_to_obs(adata, ["age"], copy_obs=False) >>> new_adata = ep.ad.move_to_x(adata, ["age"])