ehrapy.anndata.move_to_obs#
- ehrapy.anndata.move_to_obs(edata, 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 categorical.
- Parameters:
- Return type:
- Returns:
The original data object with moved or copied columns from X to obs
Examples
>>> import ehrdata as ed >>> import ehrapy as ep >>> edata = ed.dt.mimic_2() >>> ep.ad.move_to_obs(edata, ["age"], copy_obs=False)