ehrapy.anndata.move_to_obs#
- ehrapy.anndata.move_to_obs(adata, to_obs, copy_obs=False)[source]#
Move inplace or copy features from X to obs.
Note that columns containing boolean values (either 0/1 or True( true)/False(false)) will be stored as boolean columns whereas the other non numerical columns will be stored as category.
- Parameters:
- Return type:
- Returns:
The original AnnData object with moved or copied columns from X to obs
Examples
>>> import ehrapy as ep >>> adata = ep.dt.mimic_2(encoded=True) >>> ep.ad.move_to_obs(adata, ['age'], copy_obs=False)