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 | imdb_id   |    revenue | cast                                                                                       |
|--------:|:----------|-----------:|:-------------------------------------------------------------------------------------------|
|     970 | tt0848228 | 1519557910 | Robert Downey Jr., Chris Evans, Mark Ruffalo, Chris Hemsworth, Scarlett Johansson          |
|     971 | tt1496025 |  132400000 | Kate Beckinsale, Stephen Rea, Michael Ealy, Theo James, India Eisley                       |
|     972 | tt1345836 | 1081041287 | Christian Bale, Michael Caine, Gary Oldman, Anne Hathaway, Tom Hardy                       |
|     973 | tt1853728 |  425368238 | Jamie Foxx, Christoph Waltz, Leonardo DiCaprio, Kerry Washington, Samuel L. Jackson        |
|     974 | tt1074638 | 1108561013 | Daniel Craig, Judi Dench, Javier Bardem, Ralph Fiennes, Naomie Harris                      |
|     975 | tt1194173 |  276572938 | Jeremy Renner, Rachel Weisz, Edward Norton, Scott Glenn, Stacy Keach                       |
|     976 | tt0903624 | 1017003568 | Ian McKellen, Martin Freeman, Richard Armitage, Andy Serkis, Cate Blanchett                |
|     977 | tt1446714 |  403170142 | Noomi Rapace, Michael Fassbender, Charlize Theron, Idris Elba, Guy Pearce                  |
|     978 | tt1045658 |  205738714 | Bradley Cooper, Jennifer Lawrence, Robert De Niro, Jacki Weaver, Chris Tucker              |
|     979 | tt0948470 |  752215857 | Andrew Garfield, Emma Stone, Rhys Ifans, Denis Leary, Martin Sheen                         |
|     980 | tt1217209 |  538983207 | Kelly Macdonald, Julie Walters, Billy Connolly, Emma Thompson, Kevin McKidd                |
|     981 | tt1735898 |  396600000 | Kristen Stewart, Charlize Theron, Chris Hemsworth, Sam Claflin, Ian McShane                |
|     982 | tt1232829 |  201585328 | Channing Tatum, Jonah Hill, Brie Larson, Dave Franco, Ellie Kemper                         |
|     983 | tt0454876 |  609016565 | Suraj Sharma, Irrfan Khan, Ayush Tandon, Gautam Belur, Adil Hussain                        |
|     984 | tt1667889 |  877244782 | John Leguizamo, Ray Romano, Chris Wedge, Denis Leary, Seann William Scott                  |
|     985 | tt1637725 |  549368315 | Mark Wahlberg, Mila Kunis, Seth MacFarlane, Joel McHale, Giovanni Ribisi                   |
|     986 | tt0790724 |  218340595 | Tom Cruise, Rosamund Pike, Richard Jenkins, David Oyelowo, Werner Herzog                   |
|     987 | tt1649419 |  180274123 | Naomi Watts, Ewan McGregor, Tom Holland, Samuel Joslin, Oaklee Pendergast                  |
|     988 | tt1772341 |  471222889 | John C. Reilly, Sarah Silverman, Jane Lynch, Jack McBrayer, Jamie Elman                    |
|     989 | tt1981677 |  115350426 | Anna Kendrick, Skylar Astin, Brittany Snow, Anna Camp, Rebel Wilson                        |
|     990 | tt1409024 |  624026776 | Will Smith, Tommy Lee Jones, Josh Brolin, Michael Stuhlbarg, Emma Thompson                 |
|     991 | tt1392170 |  691210692 | Jennifer Lawrence, Josh Hutcherson, Liam Hemsworth, Woody Harrelson, Elizabeth Banks       |
|     992 | tt1386703 |  198802074 | Colin Farrell, Kate Beckinsale, Jessica Biel, Bryan Cranston, Bill Nighy                   |
|     993 | tt1371111 |  130482868 | Tom Hanks, Halle Berry, Jim Broadbent, Hugo Weaving, Jim Sturgess                          |
|     994 | tt1764651 |  312573423 | Sylvester Stallone, Jason Statham, Dolph Lundgren, Bruce Willis, Arnold Schwarzenegger     |
|     995 | tt1397280 |  376141306 | Liam Neeson, Maggie Grace, Famke Janssen, Rade Serbedzija, Luke Grimes                     |
|     996 | tt1077368 |  245527149 | Johnny Depp, Michelle Pfeiffer, Helena Bonham Carter, Jackie Earle Haley, Jonny Lee Miller |
|     997 | tt1659337 |   33400000 | Logan Lerman, Emma Watson, Ezra Miller, Paul Rudd, Nina Dobrev                             |
|     998 | tt1024648 |  232324128 | Ben Affleck, Bryan Cranston, Alan Arkin, John Goodman, Victor Garber                       |
|     999 | tt1605630 |  234989584 | Jason Biggs, Alyson Hannigan, Seann William Scott, Chris Klein, Thomas Ian Nicholas        |
|    1000 | tt1915581 |  167221571 | Channing Tatum, Matthew McConaughey, Olivia Munn, Cody Horn, Alex Pettyfer                 |
|    1001 | tt1259521 |   66486080 | Kristen Connolly, Chris Hemsworth, Anna Hutchison, Fran Kranz, Jesse Williams              |
|    1002 | tt1446192 |  306941670 | Chris Pine, Alec Baldwin, Jude Law, Isla Fisher, Hugh Jackman                              |
|    1003 | tt1606389 |  196114570 | Rachel McAdams, Channing Tatum, Sam Neill, Scott Speedman, Jessica Lange                   |
|    1004 | tt1397514 |  355692760 | Dwayne Johnson, Josh Hutcherson, Kristin Davis, Vanessa Hudgens, Luis GuzmÃ¡n              |
|    1005 | tt1656190 |   40346186 | Jason Statham, Chris Sarandon, James Hong, Catherine Chan, Robert John Burke               |
|    1006 | tt1611224 |  112265139 | Benjamin Walker, Dominic Cooper, Anthony Mackie, Mary Elizabeth Winstead, Rufus Sewell     |
|    1007 | tt1374992 |    8106475 | Kirsten Dunst, Jim Sturgess, Timothy Spall, James Kidnie, Heidi Hawkins                    |
|    1008 | tt1482459 |  348840316 | Zac Efron, Danny DeVito, Taylor Swift, Ed Helms, Rob Riggle                                |
|    1009 | tt1748122 |   68263166 | Bruce Willis, Edward Norton, Jared Gilman, Kara Hayward, Bill Murray                       |
|    1010 | tt1343727 |   41037742 | Karl Urban, Olivia Thirlby, Lena Headey, Wood Harris, Jason Cope                           |
|    1011 | tt1440129 |  303025485 | Taylor Kitsch, Alexander SkarsgÃ¥rd, Rihanna, Brooklyn Decker, Tadanobu Asano              |
|    1012 | tt1707386 |  441809770 | Hugh Jackman, Russell Crowe, Anne Hathaway, Amanda Seyfried, Sacha Baron Cohen             |
|    1013 | tt1667353 |  183018522 | Julia Roberts, Lily Collins, Armie Hammer, Nathan Lane, Martin Klebba                      |
|    1014 | tt0401729 |  284139100 | Taylor Kitsch, Lynn Collins, Mark Strong, Willem Dafoe, CiarÃ¡n Hinds                      |
|    1015 | tt1276104 |   47042000 | Joseph Gordon-Levitt, Bruce Willis, Emily Blunt, Paul Dano, Noah Segan                     |
|    1016 | tt1673434 |  829000000 | Kristen Stewart, Robert Pattinson, Taylor Lautner, Peter Facinelli, Elizabeth Reaser       |
|    1017 | tt1790885 |  132820716 | Jessica Chastain, Jason Clarke, Mark Strong, Joel Edgerton, Chris Pratt                    |
|    1018 | tt1506999 |   33372606 | Gina Carano, Ewan McGregor, Michael Fassbender, Bill Paxton, Channing Tatum                |
|    1019 | tt1646987 |  301000000 | Sam Worthington, Liam Neeson, Ralph Fiennes, Rosamund Pike, Edgar RamÃ­rez                  |
|    1020 | tt1800741 |  140470746 | Kathryn McCormick, Ryan Guzman, Stephen Boss, Megan Boone, Jessica Guadix                  |
|    1021 | tt1706593 |  145000000 | Dane DeHaan, Alex Russell, Michael B. Jordan, Michael Kelly, Anna Wood                     |
|    1022 | tt1591479 |   81272766 | Roselyn SÃ¡nchez, Emilio Rivera, Nestor Serrano, Gonzalo Menendez, Alexander Asefa         |
|    1023 | tt0837562 |  358375603 | Adam Sandler, Steve Buscemi, David Spade, Kevin James, Selena Gomez                        |
|    1024 | tt1855199 |   48126384 | Jake Gyllenhaal, Michael PeÃ±a, Natalie Martinez, Anna Kendrick, David Harbour             |
|    1025 | tt1586265 |   79700000 | Cameron Diaz, Jennifer Lopez, Elizabeth Banks, Anna Kendrick, Brooklyn Decker              |
|    1026 | tt1645170 |  179379533 | Sacha Baron Cohen, Sayed Badreya, Aasif Mandvi, Megan Fox, Anna Faris                      |
|    1027 | tt1636826 |  100000000 | Oliver Cooper, Jonathan Daniel Brown, Thomas Mann, Dax Flame, Kirby Bliss Blanton          |
|    1028 | tt1524137 |   63100000 | Mark Wahlberg, Kate Beckinsale, Ben Foster, Giovanni Ribisi, J.K. Simmons                  |
|    1029 | tt1277953 |  746921274 | Ben Stiller, Sacha Baron Cohen, David Schwimmer, Frances McDormand, Chris Rock             |
|    1030 | tt1212450 |   53676580 | Shia LaBeouf, Tom Hardy, Guy Pearce, Jessica Chastain, Mia Wasikowska                      |
|    1031 | tt1486192 |   29657751 | John Cusack, Luke Evans, Alice Eve, Brendan Gleeson, Kevin McNally                         |
|    1032 | tt1336608 |   59418613 | Tom Cruise, Alec Baldwin, Diego Boneta, Julianne Hough, Bryan Cranston                     |
|    1033 | tt1656186 |    2106557 | Nicolas Cage, Malin Ã…kerman, Josh Lucas, Sami Gayle, Danny Huston                         |
|    1034 | tt1430626 |  118338361 | Hugh Grant, Brendan Gleeson, Jeremy Piven, Brian Blessed, Salma Hayek                      |
|    1035 | tt1560747 |   28258060 | Joaquin Phoenix, Philip Seymour Hoffman, Amy Adams, Laura Dern, Jesse Plemons              |
|    1036 | tt1195478 |   53909751 | Emily Blunt, Alison Brie, Jason Segel, Rhys Ifans, Chris Pratt                             |
|    1037 | tt1758830 |   88058786 | Paul Rudd, Leslie Mann, Jason Segel, Maude Apatow, Megan Fox                               |
|    1038 | tt1592525 |   32204030 | Guy Pearce, Maggie Grace, Joseph Gilgun, Lennie James, Peter Stormare                      |
|    1039 | tt1655460 |   24159934 | Paul Rudd, Jennifer Aniston, Justin Theroux, Malin Ã…kerman, Lauren Ambrose                |
|    1040 | tt1596365 |  127730736 | Daniel Radcliffe, CiarÃ¡n Hinds, Sidney Johnston, Alisa Khazanova, Mary Stockley           |
|    1041 | tt1142977 |   81491068 | Charlie Tahan, Winona Ryder, Catherine O'Hara, Martin Short, Martin Landau                 |
|    1042 | tt1232200 |   58058367 | Adam Sandler, Susan Sarandon, Eva Amurri Martino, Leighton Meester, Andy Samberg           |
|    1043 | tt1599348 |  208076205 | Denzel Washington, Ryan Reynolds, Vera Farmiga, Joel Kinnaman, Brendan Gleeson             |
|    1044 | tt1615065 |   47000000 | Blake Lively, Taylor Kitsch, Aaron Taylor-Johnson, Benicio del Toro, Salma Hayek           |
|    1045 | tt1568338 |   46221189 | Sam Worthington, Elizabeth Banks, Jamie Bell, Ed Harris, Edward Burns                      |
|    1046 | tt1931533 |   19422261 | Colin Farrell, Sam Rockwell, Christopher Walken, Woody Harrelson, Abbie Cornish            |
|    1047 | tt1430615 |   24719215 | Drew Barrymore, John Krasinski, Kristen Bell, Vinessa Shaw, Dermot Mulroney                |
|    1048 | tt1433811 |    3428048 | Jason Bateman, Hope Davis, Frank Grillo, Paula Patton, Michael Nyqvist                     |
|    1049 | tt1716777 |   12434778 | Chris Pine, Elizabeth Banks, Olivia Wilde, Michelle Pfeiffer, Mark Duplass                 |
|    1050 | tt1714203 |    8493728 | Danielle Panabaker, Matt Bush, Katrina Bowden, Jean-Luc Bilodeau, David Koechner           |
|    1051 | tt0431021 |   85446075 | Jeffrey Dean Morgan, Natasha Calis, Madison Davenport, Kyra Sedgwick, Rob LaBelle          |
|    1052 | tt0938330 |   52302796 | Adelaide Clemens, Kit Harington, Sean Bean, Carrie-Anne Moss, Radha Mitchell               |
|    1053 | tt1764234 |   37930465 | Brad Pitt, Scoot McNairy, Ben Mendelsohn, James Gandolfini, Ray Liotta                     |
|    1054 | tt1366365 |   16863583 | Henry Cavill, VerÃ³nica Echegui, Sigourney Weaver, Bruce Willis, Caroline Goodall          |
|    1055 | tt1764183 |   35485056 | Richard Gere, Susan Sarandon, Tim Roth, Brit Marling, Monica Raymund                       |
|    1056 | tt1234719 |   44806783 | Chris Hemsworth, Josh Hutcherson, Isabel Lucas, Adrianne Palicki, Jeffrey Dean Morgan      |
|    1057 | tt0383010 |   54819301 | Sean Hayes, Will Sasso, Chris Diamantopoulos, SofÃ­a Vergara, Jane Lynch                    |
|    1058 | tt1535438 |  114281051 | Meryl Streep, Steve Carell, Tommy Lee Jones, Jean Smart, Marin Ireland                     |
|    1059 | tt0763831 |   22044277 | Eddie Murphy, Allison Janney, Cliff Curtis, Clark Duke, Kerry Washington                   |
|    1060 | tt1712170 |   30353232 | Tyler Perry, Rachel Nichols, Jean Reno, Matthew Fox, Giancarlo Esposito                    |
|    1061 | tt1598828 |   36893721 | Katherine Heigl, John Leguizamo, Debbie Reynolds, Sherri Shepherd, Patrick Fischler        |
|    1062 | tt1441951 |   59520298 | Maggie Smith, Tom Courtenay, Billy Connolly, Pauline Collins, Michael Gambon               |
|    1063 | tt1623288 |  107139399 | Kodi Smit-McPhee, Tucker Albrizzi, Jodelle Ferland, Anna Kendrick, Casey Affleck           |
|    1064 | tt2091473 |    8138788 | Matt Damon, John Krasinski, Frances McDormand, Rosemarie DeWitt, Lucas Black               |
|    1065 | tt2023453 |   77112176 | Devon Bostick, Steve Zahn, Peyton List, Rachael Harris, Zachary Gordon                     |
|    1066 | tt1566501 |    9622846 | Eva Longoria, Andy GarcÃ­a, Oscar Isaac, Peter O'Toole, RubÃ©n Blades                       |
|    1067 | tt0485985 |   50365377 | Bryan Cranston, David Oyelowo, Cuba Gooding Jr., Daniela Ruah, Terrence Howard             |
|    1068 | tt1663143 |   11417362 | Victoria Justice, Jackson Nicoll, Chelsea Handler, Josh Pence, Jane Levy                   |
|    1069 | tt1547234 |   31083599 | Joseph Gordon-Levitt, Michael Shannon, Dania Ramirez, Jamie Chung, WolÃ© Parks             |

## Output:


source: notebook
label: explode