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 (DataFrame) – The input data frame

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

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

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

Return type:

DataFrame

Returns:

The flattened DataFrame