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:
|   itemID |   brand | categories                                                                           |
|---------:|--------:|:-------------------------------------------------------------------------------------|
|    22665 |     861 | 2890,  855,  3908,  3909                                                             |
|    28640 |    1366 |                                                                                      |
|    13526 |    1090 | 3270,  163,  284,  1694,  12,  3837,  2422,  3595,  3561,  3912,  3913,  3914,  3915 |
|    21399 |    1090 | 3270                                                                                 |
|     8504 |     768 | 2470                                                                                 |
|    32122 |       5 |                                                                                      |
|    31956 |    1388 | 236,  3625,  356                                                                     |
|     6237 |    1492 | 2658,  1686                                                                          |
|    16971 |     288 | 390,  2678,  1708                                                                    |
|    18385 |     288 | 390,  1708                                                                           |
|    12775 |     322 | 3222,  1170,  2296,  3751,  3399,  1772,  3917                                       |
|     8285 |     734 | 3259,  2144,  2984,  677,  3349                                                      |
|    16238 |    1180 | 2942                                                                                 |
|    29828 |    1180 | 2942                                                                                 |
|    13025 |     589 | 1091,  2325                                                                          |
|    18912 |     703 | 474,  1330,  3471                                                                    |
|      366 |    1366 |                                                                                      |
|    17432 |    1277 | 1807                                                                                 |
|     4119 |     167 |                                                                                      |
|     1954 |    1277 | 1920,  3919                                                                          |
|    14612 |    1277 |                                                                                      |
|     1373 |    1277 |                                                                                      |
|     2440 |     322 | 1984                                                                                 |
|     6084 |    1040 | 1373,  2022,  1581                                                                   |
|    31733 |    1040 |                                                                                      |
|    19652 |     703 | 1330,  332,  3471                                                                    |
|     7002 |     752 | 2797,  2865                                                                          |
|     1504 |     752 | 2797,  2865                                                                          |
|     3914 |    1201 | 2020,  327,  3920,  3921,  3922                                                      |
|    24190 |    1201 | 2020,  327,  3920,  3921,  3922                                                      |
|     7811 |    1371 | 614,  3916                                                                           |
|    21408 |     440 |                                                                                      |
|    20836 |    1023 | 1147,  2790,  1085,  1578,  3084,  668,  1097,  655                                  |
|    23438 |    1023 | 1147,  2790,  1085,  1578,  3084,  668,  655                                         |
|     2722 |    1023 | 1147,  2790,  1578,  3084,  668,  655                                                |
|    32457 |     238 | 3818,  2136                                                                          |
|    27772 |     238 | 3818,  2136,  3307,  3364                                                            |
|    26813 |     239 |                                                                                      |
|    19733 |     239 |                                                                                      |
|    30317 |     238 | 3818,  2136,  31,  3925,  3926                                                       |
|    10963 |     454 | 1055,  3927                                                                          |
|    16219 |      62 | 2833,  498                                                                           |
|    16010 |     715 | 1807,  2203,  2716                                                                   |
|    29149 |    1379 | 3169,  1920,  1136,  3923                                                            |
|    22075 |    1385 |                                                                                      |
|    22480 |     791 | 3900,  3901,  3902,  3903,  3910,  3911,  3639,  1085,  3912,  3914,  3924,  3915    |
|    21222 |     238 | 3818,  2136                                                                          |
|    17997 |     239 |                                                                                      |
|    29010 |     249 | 3683,  2833,  1694,  2863,  1085,  1083,  522                                        |
|    29270 |     239 |                                                                                      |
|    29191 |     238 | 3818,  2136                                                                          |
|    27816 |    1023 | 1147,  2790,  1085,  1578,  3470,  1097,  655,  2209                                 |
|    13585 |     239 | 3254,  1646                                                                          |
|    13331 |     238 | 3818,  2136,  3926                                                                   |
|     9577 |     239 | 3254,  1646                                                                          |
|    13653 |     238 | 3818,  2136,  379,  3929,  3930                                                      |
|     8535 |     279 | 585,  2731,  3639,  3931                                                             |
|    15811 |     238 | 3818,  2136                                                                          |
|    18781 |     239 | 3827,  1611                                                                          |
|    32346 |     361 | 3107,  3540,  1529,  3469                                                            |
|     9206 |    1201 | 1012,  1555,  1350                                                                   |
|    25833 |     139 | 1920,  3907,  3932                                                                   |
|    12742 |    1201 | 1012,  1555,  1350                                                                   |
|     1033 |     193 | 2131,  2091,  1421,  2632                                                            |
|      256 |     265 | 300                                                                                  |
|     4232 |     598 | 1807                                                                                 |
|     9860 |     598 | 1807                                                                                 |
|    15336 |     239 |                                                                                      |
|    26013 |    1237 |                                                                                      |
|    25566 |     239 |                                                                                      |
|    19233 |    1237 | 1608                                                                                 |
|    30464 |     239 |                                                                                      |
|    24529 |     239 | 3827,  2269                                                                          |
|    23188 |     239 | 3827,  2269                                                                          |
|    21393 |     368 |                                                                                      |
|    22819 |     239 |                                                                                      |
|    27720 |     239 |                                                                                      |
|    26970 |     227 |                                                                                      |
|    26024 |     227 | 1807                                                                                 |
|    19595 |    1496 | 3652,  30,  1060,  3268,  2104,  3935,  3936,  3937                                  |
|     2392 |     315 | 667                                                                                  |
|    25501 |     622 |                                                                                      |
|    29683 |    1445 | 664,  2209,  669,  1760,  1667,  3283,  3915                                         |
|    18084 |    1383 | 2833,  1083,  2325                                                                   |
|    21573 |     398 | 1807                                                                                 |
|    13420 |     939 |                                                                                      |
|     7610 |     239 |                                                                                      |
|      819 |    1006 | 3138                                                                                 |
|    31771 |     239 | 3827,  3838                                                                          |
|     9911 |    1111 | 3900,  3901,  3902,  3903,  3910,  383,  1886                                        |
|      252 |     979 | 2473,  3900,  3905,  1816,  2209,  3226                                              |
|     7674 |     242 | 146,  1138                                                                           |
|     9634 |     979 | 2470,  3900,  3905,  1816,  2209                                                     |
|    11435 |     979 | 914,  2473,  3900,  3905,  2808,  1816,  2209                                        |
|    14289 |     734 | 2733,  1688,  985,  3610,  1007                                                      |
|    20693 |    1250 |                                                                                      |
|    14790 |     622 |                                                                                      |
|    26906 |     765 | 1591,  2312,  1283                                                                   |
|      337 |     765 | 1591,  1283                                                                          |
|    27223 |    1278 | 3024,  3938                                                                          |

## Output:


source: notebook
label: explode