morpheus.utils.compare_df

Functions

compare_df(df_a, df_b[, include_columns, ...]) Compares two pandas Dataframe, returning a comparison summary as a dict in the form of.
filter_df(df, include_columns, exclude_columns) Filters the dataframe df including and excluding the columns specified by include_columns and exclude_columns respectively.
compare_df(df_a, df_b, include_columns=None, exclude_columns=None, replace_idx=None, abs_tol=0.001, rel_tol=0.005, dfa_name='val', dfb_name='res', show_report=False)[source]

Compares two pandas Dataframe, returning a comparison summary as a dict in the form of:

filter_df(df, include_columns, exclude_columns, replace_idx=None)[source]

Filters the dataframe df including and excluding the columns specified by include_columns and exclude_columns respectively. If a column is matched by both include_columns and exclude_columns, it will be excluded.

Parameters
df

Dataframe to filter.

include_columns

List of regular expression strings of columns to be included.

exclude_columns

List of regular expression strings of columns to be excluded.

replace_idx: str, optional

When replace_idx is not None and existsa in the dataframe it will be set as the index.

Returns
pd.DataFrame

Filtered slice of df.

Previous morpheus.utils.column_info.StringJoinColumn
Next morpheus.utils.concat_df
© Copyright 2024, NVIDIA. Last updated on Apr 11, 2024.