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:
| Country of origin or     | 2006     | 2007     | 2008     | 2009     | 2010     | 2011     | 2012     | 2013     | 2014     | 2015     |
| declared nationality     |          |          |          |          |          |          |          |          |          |          |
|:-------------------------|:---------|:---------|:---------|:---------|:---------|:---------|:---------|:---------|:---------|:---------|
| EU Countries             |          |          |          |          |          |          |          |          |          |          |
| Austria                  | 769.0    | 814.0    | 670.0    | 338.0    | 290.0    | 313.0    | 300.0    | 334.0    | 286.0    | 289.0    |
| Belgium                  | 506.0    | 523.0    | 466.0    | 288.0    | 278.0    | 336.0    | 281.0    | 326.0    | 370.0    | 366.0    |
| Bulgaria(1)              | 267.0    | 1008.0   | 772.0    | 277.0    | 295.0    | 281.0    | 469.0    | 879.0    | 883.0    | 1098.0   |
| Croatia                  | 176.0    | 170.0    | 123.0    | 60.0     | 51.0     | 60.0     | 86.0     | 486.0    | 2091.0   | 4342.0   |
| Cyprus(2)                | 33.0     | 43.0     | 19.0     | 26.0     | 21.0     | 21.0     | 20.0     | 53.0     | 124.0    | 42.0     |
| Czech Republic(2)        | 4458.0   | 3838.0   | 2762.0   | 901.0    | 712.0    | 621.0    | 594.0    | 693.0    | 654.0    | 718.0    |
| Denmark                  | 286.0    | 338.0    | 349.0    | 209.0    | 324.0    | 306.0    | 319.0    | 266.0    | 222.0    | 240.0    |
| Estonia(2)               | 1407.0   | 648.0    | 572.0    | 428.0    | 207.0    | 155.0    | 259.0    | 231.0    | 237.0    | 184.0    |
| Finland                  | 508.0    | 473.0    | 372.0    | 153.0    | 188.0    | 181.0    | 203.0    | 223.0    | 189.0    | 241.0    |
| France                   | 6880.0   | 7673.0   | 7066.0   | 3109.0   | 2877.0   | 2668.0   | 2915.0   | 3175.0   | 3739.0   | 3744.0   |
| Germany                  | 4605.0   | 4534.0   | 3823.0   | 2090.0   | 2090.0   | 2160.0   | 2142.0   | 2162.0   | 2406.0   | 2455.0   |
| Greece                   | 207.0    | 167.0    | 168.0    | 100.0    | 124.0    | 168.0    | 269.0    | 275.0    | 332.0    | 408.0    |
| Hungary(2)               | 4330.0   | 5046.0   | 4562.0   | 1794.0   | 1584.0   | 1556.0   | 1985.0   | 1881.0   | 1727.0   | 1617.0   |
| Ireland(3)               | 84740.0  | 90238.0  | 92999.0  | 86748.0  | 85939.0  | 85210.0  | 81772.0  | 78630.0  | 76091.0  | 75008.0  |
| Italy                    | 4222.0   | 4715.0   | 4428.0   | 2237.0   | 2039.0   | 2095.0   | 2680.0   | 3552.0   | 4263.0   | 4130.0   |
| Latvia(2)                | 7954.0   | 4674.0   | 3727.0   | 3916.0   | 3134.0   | 2195.0   | 1759.0   | 1568.0   | 1312.0   | 1171.0   |
| Lithuania(2)             | 16039.0  | 10728.0  | 6443.0   | 3768.0   | 4353.0   | 3555.0   | 2860.0   | 2521.0   | 2316.0   | 2337.0   |
| Luxembourg               | 18.0     | 10.0     | 19.0     | 15.0     | 11.0     | 7.0      | 3.0      | 21.0     | 24.0     | 15.0     |
| Malta(2)                 | 143.0    | 161.0    | 132.0    | 69.0     | 57.0     | 51.0     | 46.0     | 32.0     | 50.0     | 49.0     |
| Netherlands              | 1104.0   | 1051.0   | 904.0    | 647.0    | 649.0    | 710.0    | 654.0    | 823.0    | 882.0    | 825.0    |
| Poland(2)                | 93787.0  | 79816.0  | 42553.0  | 13794.0  | 8742.0   | 8087.0   | 8663.0   | 9243.0   | 9126.0   | 8593.0   |
| Portugal                 | 935.0    | 1517.0   | 2125.0   | 1125.0   | 786.0    | 706.0    | 1128.0   | 1577.0   | 1946.0   | 1622.0   |
| Romania(2)               | 3336.0   | 14525.0  | 6762.0   | 2624.0   | 3002.0   | 3841.0   | 5283.0   | 7709.0   | 9076.0   | 8638.0   |
| Slovakia(2)              | 10687.0  | 8375.0   | 4994.0   | 1784.0   | 1288.0   | 1012.0   | 1138.0   | 1092.0   | 1081.0   | 957.0    |
| Slovenia(2)              | 101.0    | 63.0     | 87.0     | 40.0     | 37.0     | 42.0     | 47.0     | 56.0     | 72.0     | 90.0     |
| Spain                    | 4433.0   | 4691.0   | 4618.0   | 2595.0   | 2388.0   | 2604.0   | 3929.0   | 5000.0   | 5195.0   | 4351.0   |
| Sweden                   | 1103.0   | 932.0    | 757.0    | 481.0    | 629.0    | 582.0    | 499.0    | 480.0    | 473.0    | 515.0    |
| United Kingdom           | 22283.0  | 22040.0  | 19707.0  | 13996.0  | 13437.0  | 13135.0  | 12727.0  | 13135.0  | 13729.0  | 14758.0  |
| Total EU                 | 275317.0 | 268811.0 | 211979.0 | 143612.0 | 135532.0 | 132658.0 | 133030.0 | 136423.0 | 138896.0 | 138803.0 |
| Non-EU Countries         |          |          |          |          |          |          |          |          |          |          |
| Brazil                   | 3460.0   | 4805.0   | 5632.0   | 2741.0   | 4257.0   | 4939.0   | 5542.0   | 6270.0   | 7778.0   | 5052.0   |
| United States of America | 4079.0   | 3841.0   | 3504.0   | 2544.0   | 2518.0   | 2705.0   | 2697.0   | 3048.0   | 3403.0   | 3337.0   |
| India                    | 5580.0   | 4778.0   | 4332.0   | 2249.0   | 1430.0   | 1475.0   | 1854.0   | 2620.0   | 2815.0   | 3132.0   |
| Venezuela                | 53.0     | 71.0     | 66.0     | 52.0     | 169.0    | 346.0    | 409.0    | 2227.0   | 1639.0   | 69.0     |
| China                    | 1418.0   | 1519.0   | 1685.0   | 1266.0   | 977.0    | 877.0    | 1138.0   | 1099.0   | 1416.0   | 1145.0   |
| Republic of Korea        | 491.0    | 948.0    | 1147.0   | 431.0    | 558.0    | 505.0    | 678.0    | 1043.0   | 1271.0   | 513.0    |
| Pakistan                 | 1425.0   | 1439.0   | 911.0    | 868.0    | 478.0    | 807.0    | 741.0    | 891.0    | 1618.0   | 3168.0   |
| Canada                   | 1161.0   | 1071.0   | 1213.0   | 841.0    | 698.0    | 606.0    | 613.0    | 739.0    | 841.0    | 886.0    |
| Australia                | 2105.0   | 1966.0   | 1857.0   | 1013.0   | 688.0    | 554.0    | 587.0    | 644.0    | 883.0    | 1043.0   |
| Nigeria                  | 1623.0   | 1610.0   | 1545.0   | 888.0    | 513.0    | 482.0    | 421.0    | 545.0    | 647.0    | 613.0    |
| Mexico                   | 158.0    | 169.0    | 189.0    | 160.0    | 290.0    | 316.0    | 384.0    | 545.0    | 774.0    | 439.0    |
| Saudi Arabia             | 38.0     | 36.0     | 33.0     | 159.0    | 247.0    | 288.0    | 344.0    | 480.0    | 481.0    | 337.0    |
| Malaysia                 | 636.0    | 744.0    | 656.0    | 436.0    | 410.0    | 291.0    | 362.0    | 435.0    | 540.0    | 502.0    |
| Philippines              | 1884.0   | 1624.0   | 1440.0   | 695.0    | 394.0    | 434.0    | 414.0    | 429.0    | 413.0    | 428.0    |
| Japan                    | 277.0    | 426.0    | 445.0    | 248.0    | 232.0    | 275.0    | 281.0    | 359.0    | 387.0    | 280.0    |
| South Africa             | 1126.0   | 1046.0   | 1105.0   | 678.0    | 413.0    | 346.0    | 344.0    | 354.0    | 448.0    | 482.0    |
| Russia                   | 464.0    | 398.0    | 358.0    | 258.0    | 233.0    | 267.0    | 258.0    | 329.0    | 357.0    | 417.0    |
| Libya                    | 51.0     | 27.0     | 26.0     | 30.0     | 21.0     | 40.0     | 58.0     | 276.0    | 254.0    | 61.0     |
| Ukraine                  | 405.0    | 394.0    | 467.0    | 302.0    | 150.0    | 167.0    | 182.0    | 257.0    | 293.0    | 341.0    |
| New Zealand              | 1010.0   | 886.0    | 819.0    | 413.0    | 238.0    | 194.0    | 200.0    | 212.0    | 275.0    | 273.0    |
| Switzerland              | 291.0    | 262.0    | 277.0    | 156.0    | 143.0    | 180.0    | 171.0    | 202.0    | 185.0    | 221.0    |
| Argentina                | 212.0    | 201.0    | 137.0    | 158.0    | 143.0    | 155.0    | 185.0    | 200.0    | 258.0    | 169.0    |
| Bangladesh               | 456.0    | 405.0    | 240.0    | 167.0    | 109.0    | 88.0     | 134.0    | 196.0    | 311.0    | 427.0    |
| Nepal                    | 66.0     | 84.0     | 94.0     | 97.0     | 107.0    | 93.0     | 103.0    | 187.0    | 202.0    | 103.0    |
| Egypt                    | 206.0    | 263.0    | 337.0    | 201.0    | 93.0     | 99.0     | 147.0    | 184.0    | 239.0    | 294.0    |
| Norway                   | 196.0    | 218.0    | 240.0    | 196.0    | 187.0    | 195.0    | 122.0    | 168.0    | 191.0    | 185.0    |
| Turkey                   | 165.0    | 228.0    | 197.0    | 140.0    | 117.0    | 131.0    | 122.0    | 156.0    | 233.0    | 206.0    |
| Thailand                 | 210.0    | 271.0    | 275.0    | 224.0    | 175.0    | 161.0    | 168.0    | 141.0    | 112.0    | 142.0    |
| Moldova                  | 294.0    | 409.0    | 300.0    | 252.0    | 124.0    | 93.0     | 90.0     | 124.0    | 116.0    | 88.0     |
| Mauritius                | 1938.0   | 1989.0   | 1431.0   | 887.0    | 156.0    | 46.0     | 45.0     | 40.0     | 65.0     | 33.0     |
| Other(4)                 | 5055.0   | 4671.0   | 4494.0   | 3533.0   | 2368.0   | 3237.0   | 2833.0   | 3359.0   | 5122.0   | 6522.0   |
| Total Non-EU             | 36533.0  | 36799.0  | 35452.0  | 22283.0  | 18636.0  | 20392.0  | 21627.0  | 27759.0  | 33567.0  | 30908.0  |
| Total                    | 311850.0 | 305610.0 | 247431.0 | 165895.0 | 154168.0 | 153050.0 | 154657.0 | 164182.0 | 172463.0 | 169711.0 |

## Output:


source: excel_file
label: operator: subtitle
operator: stack
stack_start_idx: 2
stack_end_idx: 11
alternative_label: operator: stack
stack_start_idx: 2
stack_end_idx: 11
operator: subtitle