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   |      gender |   SeniorCitizen |     Partner |   Dependents |    tenure |   PhoneService |   OnlineSecurity |   OnlineBackup |   DeviceProtection |   TechSupport |   StreamingTV |   StreamingMovies |   PaperlessBilling |   MonthlyCharges |   TotalCharges |       Churn |   MultipleLines_No |   MultipleLines_No phone service |   MultipleLines_Yes |   InternetService_DSL |   InternetService_Fiber optic |   InternetService_No |   Contract_Month-to-month |   Contract_One year |   Contract_Two year |   PaymentMethod_Bank transfer (automatic) |   PaymentMethod_Credit card (automatic) |   PaymentMethod_Electronic check |   PaymentMethod_Mailed check |
|:--------|------------:|----------------:|------------:|-------------:|----------:|---------------:|-----------------:|---------------:|-------------------:|--------------:|--------------:|------------------:|-------------------:|-----------------:|---------------:|------------:|-------------------:|---------------------------------:|--------------------:|----------------------:|------------------------------:|---------------------:|--------------------------:|--------------------:|--------------------:|------------------------------------------:|----------------------------------------:|---------------------------------:|-----------------------------:|
| count   | 7032        |     7032        | 7032        |  7032        | 7032      |    7032        |      7032        |    7032        |        7032        |   7032        |   7032        |       7032        |        7032        |        7032      |        7032    | 7032        |        7032        |                     7032         |         7032        |           7032        |                   7032        |          7032        |               7032        |         7032        |         7032        |                               7032        |                             7032        |                      7032        |                  7032        |
| mean    |    0.504693 |        0.1624   |    0.482509 |     0.298493 |   32.4218 |       0.903299 |         0.286547 |       0.344852 |           0.343857 |      0.290102 |      0.384386 |          0.388367 |           0.592719 |          64.7982 |        2283.3  |    0.265785 |           0.481371 |                        0.0967008 |            0.421928 |              0.343572 |                      0.440273 |             0.216155 |                  0.551052 |            0.209329 |            0.239619 |                                  0.219283 |                                0.216297 |                         0.33632  |                     0.2281   |
| std     |    0.500014 |        0.368844 |    0.499729 |     0.457629 |   24.5453 |       0.295571 |         0.45218  |       0.475354 |           0.475028 |      0.453842 |      0.486484 |          0.487414 |           0.491363 |          30.086  |        2266.77 |    0.441782 |           0.499688 |                        0.295571  |            0.493902 |              0.474934 |                      0.496455 |             0.41165  |                  0.497422 |            0.406858 |            0.426881 |                                  0.41379  |                                0.411748 |                         0.472483 |                     0.419637 |
| min     |    0        |        0        |    0        |     0        |    1      |       0        |         0        |       0        |           0        |      0        |      0        |          0        |           0        |          18.25   |          18.8  |    0        |           0        |                        0         |            0        |              0        |                      0        |             0        |                  0        |            0        |            0        |                                  0        |                                0        |                         0        |                     0        |
| 25%     |    0        |        0        |    0        |     0        |    9      |       1        |         0        |       0        |           0        |      0        |      0        |          0        |           0        |          35.5875 |         401.45 |    0        |           0        |                        0         |            0        |              0        |                      0        |             0        |                  0        |            0        |            0        |                                  0        |                                0        |                         0        |                     0        |
| 50%     |    1        |        0        |    0        |     0        |   29      |       1        |         0        |       0        |           0        |      0        |      0        |          0        |           1        |          70.35   |        1397.47 |    0        |           0        |                        0         |            0        |              0        |                      0        |             0        |                  1        |            0        |            0        |                                  0        |                                0        |                         0        |                     0        |
| 75%     |    1        |        0        |    1        |     1        |   55      |       1        |         1        |       1        |           1        |      1        |      1        |          1        |           1        |          89.8625 |        3794.74 |    1        |           1        |                        0         |            1        |              1        |                      1        |             0        |                  1        |            0        |            0        |                                  0        |                                0        |                         1        |                     0        |
| max     |    1        |        1        |    1        |     1        |   72      |       1        |         1        |       1        |           1        |      1        |      1        |          1        |           1        |         118.75   |        8684.8  |    1        |           1        |                        1         |            1        |              1        |                      1        |             1        |                  1        |            1        |            1        |                                  1        |                                1        |                         1        |                     1        |

## Output:


source: notebook
label: transpose