sktime.utils.data_processing.from_multi_index_to_nested

sktime.utils.data_processing.from_multi_index_to_nested(multi_ind_dataframe, instance_index=None, cells_as_numpy=False)[source]

Converts a pandas DataFrame witha multi-index to a nested DataFrame

Parameters
  • multi_ind_dataframe (pd.DataFrame) – Input multi-indexed pandas DataFrame

  • instance_index_name (str) – The name of multi-index level corresponding to the DataFrame’s instances

  • cells_as_numpy (bool, default = False) – If True, then nested cells contain NumPy array If False, then nested cells contain pandas Series

Returns

x_nested – The nested version of the DataFrame

Return type

pd.DataFrame