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.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"data_handle": "<data_handle>"
},
"name": "transform_data"
}
}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). |