sktime.utils.data_processing
.from_2d_array_to_nested¶
-
sktime.utils.data_processing.
from_2d_array_to_nested
(X, index=None, columns=None, time_index=None, cells_as_numpy=False)[source]¶ Convert tabular pandas DataFrame with only primitives in cells into nested pandas DataFrame with a single column.
- Parameters
X (pd.DataFrame) –
cells_as_numpy (bool, default = False) – If True, then nested cells contain NumPy array If False, then nested cells contain pandas Series
index (array-like, shape=[n_samples], optional (default = None)) – Sample (row) index of transformed DataFrame
time_index (array-like, shape=[n_obs], optional (default = None)) – Time series index of transformed DataFrame
- Returns
Xt – Transformed DataFrame in nested format
- Return type
pd.DataFrame