aixd.data.utils_data.reformat_dataframe_to_dataframeflat

aixd.data.utils_data.reformat_dataframe_to_dataframeflat(dataframe: pd.DataFrame, dataobjects: List[DataObject]) pd.DataFrame[source]

Reformats a dataframe that may represent multidimensional data objects (cells containing lists of values, if dim>1), to a flattened dataframe. In the flattened dataframe, all cells contain single values and column names are renamed. In the intended use each row corresponds to one sample.

Parameters:
  • dataframe (pd.DataFrame) – A dataframe object with collapsed columns.

  • dataobjects (List[DataObject]) – A list of data objects from the dataset.

Returns:

pd.DataFrame – New dataframe, flattened (one value per cell).