edmt.contrib

Submodules

Package Contents

edmt.contrib.clean_vars(addl_kwargs={}, **kwargs)
edmt.contrib.norm_exp(df: pandas.DataFrame, cols: str | list) pandas.DataFrame

Normalizes specified columns containing list of dicts, expands them into separate rows if needed, and appends new columns to the original dataframe with prefixing.

Parameters: - df: Original pandas DataFrame - cols: str or list of str, names of columns to normalize

Returns: - Modified DataFrame with normalized and expanded data

edmt.contrib.normalize_column(df, col)
edmt.contrib.format_iso_time(date_string: str) str
edmt.contrib.append_cols(df: pandas.DataFrame, cols: str | list)

Move specified column(s) to the end of the DataFrame.

Parameters:
  • df (pd.DataFrame) -- Input DataFrame.

  • cols (str or list) -- Column name(s) to move to the end.

Returns:

DataFrame with columns reordered.

Return type:

pd.DataFrame

edmt.contrib.dict_expand(data, cols)