awswrangler.neptune.flatten_nested_df

awswrangler.neptune.flatten_nested_df(df: DataFrame, include_prefix: bool = True, separator: str = '_', recursive: bool = True) DataFrame

Flatten the lists and dictionaries of the input data frame.

Parameters:
  • df (pd.DataFrame) – The input data frame

  • include_prefix (bool, optional) – If True, then it will prefix the new column name with the original column name. Defaults to True.

  • separator (str, optional) – The separator to use between field names when a dictionary is exploded. Defaults to “_”.

  • recursive (bool, optional) – If True, then this will recurse the fields in the data frame. Defaults to True.

Returns:

pd.DataFrame

Return type:

The flattened data frame