Task: Data-transform-reshape (source dataset: Auto-Tables)

Given a table, predict what python pandas transformation may be needed on the given input table. Valid choices for transformation include: {"stack", "wide_to_long", "transpose", "pivot", "explode", "ffill", "subtitles"}. Note that each of these is a common Python Pandas operator. Some transformations can have parameters. Each transformation and its parameters are describe as follows.
 
- stack: collapse homogeneous cols into rows.
@param (int): stack_start_idx: zero-based starting column index of the homogeneous column-group.
@param (int): stack_end_idx: zero-based ending column index of the homogeneous column-group.
 
- wide_to_long: collapse repeating col-groups into rows.
@param (int): wide_to_long_start_idx: zero-based starting column index of the repeating col-groups.
@param (int): wide_to_long_end_idx: zero-based ending column index of the repeating col-groups.
 
- transpose: convert rows to columns and vice versa.
 
- pivot: pivot repeating row-groups into cols.
@param (int): pivot_row_frequency: frequency of repeating row-groups.
 
- ffill: fill structurally empty cells in tables.
@param (int): ffill_end_idx: zero-based ending column index of the columns to be filled.
 
- explode: convert composite cells into atomic values
@param (int): explode_column_idx: zero-based column index of the column to be exploded.
 
- subtitle: convert table subtitles into a column.
 
OUTPUT the predicted transformation name along with its parameters for the given INPUT table in a JSON, e.g., {"transformation": "stack", "stack_start_idx": 1, "stack_end_idx": 5}. If the input table needs multi-step transformations (e.g, ffill followed by stack), list JSON of each transformation sequentially in a list, e.g., [{"transformation": "ffill", "ffill_end_idx": 1}, {"transformation": "stack", "stack_start_idx": 1, "stack_end_idx": 5}]. No explanation is needed.

## Input:
|   Index |   state_abuja |   state_kwara |   state_lagos |   state_ogun |   state_oyo |   state_rivers |
|--------:|--------------:|--------------:|--------------:|-------------:|------------:|---------------:|
|    5558 |             1 |             0 |             0 |            0 |           0 |              0 |
|   13781 |             0 |             0 |             1 |            0 |           0 |              0 |
|   14918 |             0 |             0 |             0 |            0 |           1 |              0 |
|   19919 |             0 |             0 |             1 |            0 |           0 |              0 |
|   16290 |             0 |             0 |             1 |            0 |           0 |              0 |
|   24325 |             0 |             0 |             1 |            0 |           0 |              0 |
|    8716 |             0 |             0 |             1 |            0 |           0 |              0 |
|   17032 |             0 |             0 |             1 |            0 |           0 |              0 |
|   19039 |             0 |             0 |             0 |            0 |           0 |              1 |
|    6274 |             0 |             0 |             1 |            0 |           0 |              0 |
|    8683 |             0 |             0 |             1 |            0 |           0 |              0 |
|    7266 |             1 |             0 |             0 |            0 |           0 |              0 |
|   19837 |             0 |             0 |             0 |            0 |           0 |              1 |
|   16168 |             0 |             0 |             1 |            0 |           0 |              0 |
|    4721 |             0 |             0 |             1 |            0 |           0 |              0 |
|   17021 |             0 |             0 |             1 |            0 |           0 |              0 |
|   16490 |             0 |             0 |             1 |            0 |           0 |              0 |
|   15157 |             0 |             0 |             1 |            0 |           0 |              0 |
|   21668 |             1 |             0 |             0 |            0 |           0 |              0 |
|   10870 |             0 |             0 |             1 |            0 |           0 |              0 |
|    6406 |             0 |             0 |             1 |            0 |           0 |              0 |
|    1157 |             0 |             0 |             1 |            0 |           0 |              0 |
|   12133 |             0 |             0 |             1 |            0 |           0 |              0 |
|   23481 |             1 |             0 |             0 |            0 |           0 |              0 |
|   12196 |             0 |             0 |             1 |            0 |           0 |              0 |
|    3663 |             0 |             0 |             1 |            0 |           0 |              0 |
|    9763 |             0 |             0 |             1 |            0 |           0 |              0 |
|      78 |             0 |             0 |             1 |            0 |           0 |              0 |
|    9997 |             0 |             0 |             1 |            0 |           0 |              0 |
|    8321 |             0 |             0 |             1 |            0 |           0 |              0 |
|    8083 |             1 |             0 |             0 |            0 |           0 |              0 |
|   21187 |             0 |             0 |             1 |            0 |           0 |              0 |
|   24883 |             0 |             0 |             1 |            0 |           0 |              0 |
|    4165 |             0 |             0 |             1 |            0 |           0 |              0 |
|   21529 |             1 |             0 |             0 |            0 |           0 |              0 |
|    1843 |             0 |             0 |             1 |            0 |           0 |              0 |
|   21350 |             0 |             0 |             1 |            0 |           0 |              0 |
|    4713 |             0 |             0 |             1 |            0 |           0 |              0 |
|   14844 |             0 |             0 |             1 |            0 |           0 |              0 |
|   19732 |             0 |             0 |             0 |            0 |           1 |              0 |
|   20361 |             0 |             0 |             0 |            0 |           1 |              0 |
|    8960 |             0 |             0 |             1 |            0 |           0 |              0 |
|   18148 |             0 |             0 |             1 |            0 |           0 |              0 |
|   19351 |             1 |             0 |             0 |            0 |           0 |              0 |
|   21119 |             0 |             0 |             0 |            0 |           1 |              0 |
|   10040 |             1 |             0 |             0 |            0 |           0 |              0 |
|   24685 |             0 |             0 |             1 |            0 |           0 |              0 |
|   18476 |             0 |             0 |             1 |            0 |           0 |              0 |
|   23678 |             0 |             0 |             1 |            0 |           0 |              0 |
|    4350 |             0 |             0 |             0 |            0 |           0 |              1 |
|    2880 |             0 |             0 |             1 |            0 |           0 |              0 |
|   23892 |             0 |             0 |             1 |            0 |           0 |              0 |
|    4021 |             0 |             0 |             1 |            0 |           0 |              0 |
|    1046 |             0 |             0 |             1 |            0 |           0 |              0 |
|   21066 |             0 |             0 |             1 |            0 |           0 |              0 |
|   19352 |             1 |             0 |             0 |            0 |           0 |              0 |
|    8049 |             0 |             0 |             1 |            0 |           0 |              0 |
|   23660 |             1 |             0 |             0 |            0 |           0 |              0 |
|    3354 |             0 |             0 |             1 |            0 |           0 |              0 |
|    4260 |             1 |             0 |             0 |            0 |           0 |              0 |
|   20536 |             0 |             0 |             0 |            0 |           1 |              0 |
|    1976 |             0 |             0 |             1 |            0 |           0 |              0 |
|   22387 |             0 |             0 |             1 |            0 |           0 |              0 |
|   21710 |             0 |             0 |             1 |            0 |           0 |              0 |
|    5572 |             0 |             0 |             1 |            0 |           0 |              0 |
|   10960 |             0 |             0 |             1 |            0 |           0 |              0 |
|   24629 |             0 |             0 |             1 |            0 |           0 |              0 |
|    6110 |             0 |             0 |             1 |            0 |           0 |              0 |
|   25119 |             0 |             0 |             1 |            0 |           0 |              0 |
|    8377 |             0 |             0 |             1 |            0 |           0 |              0 |
|   12961 |             0 |             0 |             1 |            0 |           0 |              0 |
|    5615 |             0 |             0 |             1 |            0 |           0 |              0 |
|   24522 |             0 |             0 |             1 |            0 |           0 |              0 |
|   12653 |             0 |             0 |             1 |            0 |           0 |              0 |
|     987 |             0 |             0 |             1 |            0 |           0 |              0 |
|    7754 |             1 |             0 |             0 |            0 |           0 |              0 |
|   22258 |             0 |             0 |             1 |            0 |           0 |              0 |
|   19327 |             0 |             0 |             1 |            0 |           0 |              0 |
|   12665 |             0 |             0 |             1 |            0 |           0 |              0 |
|   14350 |             0 |             0 |             1 |            0 |           0 |              0 |
|   19720 |             0 |             0 |             0 |            0 |           1 |              0 |
|   11073 |             0 |             0 |             0 |            1 |           0 |              0 |
|   19029 |             0 |             0 |             0 |            0 |           0 |              1 |
|   14841 |             0 |             0 |             1 |            0 |           0 |              0 |
|    1663 |             0 |             0 |             1 |            0 |           0 |              0 |
|   18661 |             0 |             0 |             1 |            0 |           0 |              0 |
|   24651 |             0 |             0 |             1 |            0 |           0 |              0 |
|   16920 |             0 |             0 |             1 |            0 |           0 |              0 |
|   18020 |             0 |             0 |             1 |            0 |           0 |              0 |
|   11982 |             0 |             0 |             1 |            0 |           0 |              0 |
|    2967 |             0 |             0 |             1 |            0 |           0 |              0 |
|   18069 |             0 |             0 |             1 |            0 |           0 |              0 |
|    3201 |             0 |             0 |             1 |            0 |           0 |              0 |
|   16027 |             0 |             0 |             1 |            0 |           0 |              0 |
|   22370 |             1 |             0 |             0 |            0 |           0 |              0 |
|    1235 |             0 |             0 |             1 |            0 |           0 |              0 |
|   18085 |             0 |             0 |             0 |            0 |           1 |              0 |
|   12249 |             0 |             0 |             1 |            0 |           0 |              0 |
|   14914 |             0 |             0 |             1 |            0 |           0 |              0 |
|    7804 |             0 |             0 |             1 |            0 |           0 |              0 |

## Output:


source: notebook
label: operator: stack
stack_start_idx: 1
stack_end_idx: 6
alternative_label: operator: transpose
operator: stack
stack_start_idx: 1
stack_end_idx: 6304