transform_data
Format time series data by fixing frequency, removing duplicates, filling gaps, and imputing missing values, or convert to a desired sktime mtype.
Instructions
Transform a loaded data handle and return a new handle. action='format' (default): auto-fix common time series issues — infer/set frequency, remove duplicate timestamps, fill index gaps, and forward/backward-fill missing values; returns changes_applied. action='convert': convert y to a different sktime mtype via convert_to() (requires to_mtype, e.g. 'pd.DataFrame', 'pd.Series', 'np.ndarray'). Replaces the legacy format_time_series tool.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | No | Transformation to apply: 'format' (default) or 'convert'. | format |
| to_mtype | No | (convert only, required) Target sktime mtype string, e.g. 'pd.DataFrame', 'pd.Series', 'np.ndarray'. | |
| data_handle | Yes | Data handle ID to transform. | |
| fill_missing | No | (format only) Forward/backward fill missing values (default: true). | |
| auto_infer_freq | No | (format only) Infer and set DatetimeIndex frequency (default: true). | |
| remove_duplicates | No | (format only) Drop duplicate timestamps, keeping first (default: true). |