clarite.modify.merge_variables

clarite.modify.merge_variables(left:pandas.core.frame.DataFrame, right:pandas.core.frame.DataFrame, how:str='outer')

Merge a list of dataframes with different variables side-by-side. Keep all observations (‘outer’ merge) by default.

Parameters
left: pd.Dataframe

“left” DataFrame

right: pd.DataFrame

“right” DataFrame which uses the same index

how: merge method, one of {‘left’, ‘right’, ‘inner’, ‘outer’}

Keep only rows present in the left data, the right data, both datasets, or either dataset.

Examples

>>> import clarite
>>> df = clarite.modify.merge_variables(df_bin, df_cat, how='outer')