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:
| Top level                     | Subdivision                                                                                                                                                                          |
|:------------------------------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Funding                       |                                                                                                                                                                                      |
|                               | Identify and invite co-applicants                                                                                                                                                    |
|                               | Secure funding                                                                                                                                                                       |
|                               | Budget management                                                                                                                                                                    |
|                               | Report to funder                                                                                                                                                                     |
| Trial design                  |                                                                                                                                                                                      |
|                               | Develop research idea including scientific rationale, clinical relevance, clinical feasibility                                                                                       |
|                               | Obtain statistical advice, including Sample size calculation                                                                                                                         |
|                               | Obtain peer review                                                                                                                                                                   |
| Protocol                      |                                                                                                                                                                                      |
|                               | Obtain EudraCT number and relevant registrations                                                                                                                                     |
|                               | Protocol preparation (including internal departmental review)                                                                                                                        |
|                               | Protocol review                                                                                                                                                                      |
|                               | Protocol sign-off                                                                                                                                                                    |
| Risk Assessment               |                                                                                                                                                                                      |
|                               | Develop, review and update risk assessment                                                                                                                                           |
|                               | Develop, review and update risk related plans e.g. monitoring plan                                                                                                                   |
| Sponsorship and Insurance     |                                                                                                                                                                                      |
|                               | Confirm Sponsorship                                                                                                                                                                  |
|                               | Arrange insurance and  / or where appropriate indemnity                                                                                                                              |
| Trial Master File             |                                                                                                                                                                                      |
|                               | Prepare and maintain Trial Master File (TMF)                                                                                                                                         |
| Service and Supply            |                                                                                                                                                                                      |
|                               | Identify appropriate providers in line with applicable policy                                                                                                                        |
|                               | Source study product                                                                                                                                                                 |
|                               | Source other suppliers such as CRO, lab, pharmacy, courier                                                                                                                           |
|                               | Provide trial equipment supplies                                                                                                                                                     |
|                               | Obtain / provide randomisation service                                                                                                                                               |
|                               | Identify appropriate contracts                                                                                                                                                       |
|                               | Negotiate appropriate contracts                                                                                                                                                      |
|                               | Sign off appropriate contracts                                                                                                                                                       |
| Site Selection and Management |                                                                                                                                                                                      |
|                               | Identify, select and recruit sites /  centre / hubs / investigators                                                                                                                  |
|                               | Negotiate contract with sites                                                                                                                                                        |
|                               | Sign off of contracts with sites                                                                                                                                                     |
|                               | Provide information to sites (including newsletters)                                                                                                                                 |
|                               | Conduct site training and setup                                                                                                                                                      |
|                               | Put and keep in place training / arrangements to allow investigators to conduct the trial according to the Protocol, GCP and applicable regulations                                  |
|                               | Provide Investigator Site File (ISF)                                                                                                                                                 |
|                               | Distribute trial documents to sites                                                                                                                                                  |
|                               | Activate authorised sites                                                                                                                                                            |
|                               | Oversee performance of sites                                                                                                                                                         |
|                               | Administer changes at site (including PI change)                                                                                                                                     |
|                               | Close out sites                                                                                                                                                                      |
| Site Conduct                  |                                                                                                                                                                                      |
|                               | Obtain authorisation from local regulatory bodies (e.g. host organisation)                                                                                                           |
|                               | Ensure adequate facilities, resources and support are available to conduct the study                                                                                                 |
|                               | Maintain ISF                                                                                                                                                                         |
|                               | Ensure the rights of individual participants are protected and that they receive appropriate medical care whilst participating in the trial                                          |
|                               | Ensure that no participant is recruited at site until the participating site has been activated                                                                                      |
|                               | Ensure that the appropriate consent has been provided by the participants                                                                                                            |
|                               | Ensure the appropriate delegation logs are maintained and kept up to date                                                                                                            |
|                               | Ensure overview of operational day-to-day business                                                                                                                                   |
|                               | Ensure that the study is conducted locally according to GCP, all relevant legislation and the Protocol                                                                               |
|                               | Submit all study data and material required for the study, in accordance with the Protocol and any study specific manuals.                                                           |
|                               | Report SAEs, protocol deviations  and all serious breaches of study conduct and / or GCP as required                                                                                 |
|                               | Ensure that study IMP supplies for specific use in the study are used in strict accordance with the Protocol and are not used for any other purpose.                                 |
|                               | Maintain study product storage and accountability                                                                                                                                    |
|                               | Ensure that all Clinical Data and documentation are available for the purposes of monitoring, inspection or audit                                                                    |
| Ethics Approval               |                                                                                                                                                                                      |
|                               | 0                                                                                                                                                                                    |
|                               | 1                                                                                                                                                                                    |
|                               | 2                                                                                                                                                                                    |
|                               | 3                                                                                                                                                                                    |
|                               | Obtain positive opinion from appropriate research ethics committee                                                                                                                   |
|                               | Submit and distribute annual progress reports                                                                                                                                        |
| Competent Authority Approval  |                                                                                                                                                                                      |
|                               | 0                                                                                                                                                                                    |
|                               | 1                                                                                                                                                                                    |
|                               | 2                                                                                                                                                                                    |
|                               | 3                                                                                                                                                                                    |
|                               | Obtain competent authority authorisation                                                                                                                                             |
|                               | Submit and distribute annual safety reports (e.g. DSUR)                                                                                                                              |
| Other Approvals               |                                                                                                                                                                                      |
|                               | Obtain relevant national host organisation approval e.g. HRA                                                                                                                         |
|                               | Obtain local agreement for trial conduct                                                                                                                                             |
| Trial Management              |                                                                                                                                                                                      |
|                               | Develop project plan/ overview of timelines                                                                                                                                          |
|                               | Ensure adherence to and adoption of University of Oxford Core SOPs                                                                                                                   |
|                               | Ensure that the CTU/ coordinating centre staff are appropriately qualified / trained / educated to conduct the study and where applicable honorary employment contracts are in place |
|                               | Coordinate Investigator meetings                                                                                                                                                     |
|                               | Ensure third parties compliance to appropriate regulations and other requirements                                                                                                    |
|                               | Ensure that no participant is recruited to the trial until satisfied that all relevant permissions and approvals have been obtained.                                                 |
|                               | Ensure that no participant is recruited to the trial or study activated until satisfied that all relevant systems and resources are in place.                                        |
|                               | Ensure the participants confidentiality is maintained in accordance with relevant legislation including the Data Protection Act                                                      |
| CRF/eCRF design               |                                                                                                                                                                                      |
|                               | Design and prepare CRF                                                                                                                                                               |
|                               | Review and validation CRF                                                                                                                                                            |
|                               | Generate CRF guidelines                                                                                                                                                              |
|                               | Sign off CRF                                                                                                                                                                         |
| Database design               |                                                                                                                                                                                      |
|                               | Design and build database                                                                                                                                                            |
|                               | Design and build participant registration or randomisation database                                                                                                                  |
|                               | Conduct system testing and validation                                                                                                                                                |
|                               | Conduct user acceptance testing                                                                                                                                                      |
|                               | Conduct database user training                                                                                                                                                       |
| Data Management               |                                                                                                                                                                                      |
|                               | Oversee or prepare data management plan                                                                                                                                              |
|                               | Oversee or prepare other detailed manual as required e.g. imaging                                                                                                                    |
|                               | Data coding                                                                                                                                                                          |

## Output:


source: excel_file
label: subtitle