sktime.utils.data_processing.from_nested_to_2d_array

sktime.utils.data_processing.from_nested_to_2d_array(X, return_numpy=False)[source]

Convert nested pandas DataFrame or Series with NumPy arrays or pandas Series in cells into tabular pandas DataFrame with primitives in cells, i.e. a data frame with the same number of rows as the input data and as many columns as there are observations in the nested series. Requires series to be have the same index.

Parameters
  • X (nested pd.DataFrame or nested pd.Series) –

  • return_numpy (bool, default = False) –

    • If True, returns a NumPy array of the tabular data.

    • If False, returns a pandas DataFrame with row and column names.

Returns

Xt – Transformed DataFrame in tabular format

Return type

pandas DataFrame