unpivot_data
Reshape wide Excel data into a long format by choosing identifier columns and value columns to melt. This enables easier analysis and visualization of unpivoted datasets.
Instructions
Melt (unpivot) wide-form data to long-form using id_vars and value_vars.
Args: file_path: Workbook path. sheet_name: Source sheet. id_vars: Columns to keep as identifiers. value_vars: Columns to melt into variable/value pairs. var_name: Name for the variable column. value_name: Name for the value column.
Returns: dict: Result summary and destination range if written.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id_vars | Yes | ||
| var_name | No | Variable | |
| file_path | Yes | ||
| sheet_name | Yes | ||
| value_name | No | Value | |
| value_vars | Yes |