clarite.modify.colfilterΒΆ

clarite.modify.colfilter(data, skip:Union[str, List[str], NoneType]=None, only:Union[str, List[str], NoneType]=None)ΒΆ

Remove some variables (skip) or keep only certain variables (only)

Parameters
data: pd.DataFrame

The DataFrame to be processed and returned

skip: str, list or None (default is None)

List of variables to remove

only: str, list or None (default is None)

List of variables to keep

Returns
data: pd.DataFrame

The filtered DataFrame

Examples

>>> import clarite
>>> female_logBMI = clarite.modify.colfilter(nhanes, only=['BMXBMI', 'female'])
================================================================================
Running colfilter
--------------------------------------------------------------------------------
Keeping 2 of 945 variables:
        0 of 0 binary variables
        0 of 0 categorical variables
        2 of 945 continuous variables
        0 of 0 unknown variables
================================================================================