Skip to content

load_data_timeline_surgery

Load and return the MSK-IMPACT surgical timeline dataset (deidentified).

Returns:

Name Type Description
data Bunch

Dictionary-like object, with the following attributes.

  • data : pandas DataFrame The data matrix.
  • description_columns (Future release) : list The names of the dataset columns.
  • description_dataset (Future release) : str The full description of the dataset.
  • filename (Future release) : str The path to the location of the data.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
from msk_cdm.datasets import connect_to_db
from msk_cdm.datasets.impact import load_data_timeline_surgery

# Connect to the database
auth_file = 'path/to/config.txt'
connect_to_db(auth_file=auth_file)

# Load the dataset
df_timeline_surgery = load_data_timeline_surgery()

# Access the data
df_surg = df_timeline_surgery['data']

# Display the first few rows of the data
print(df_surg.head())
Source code in msk_cdm/datasets/impact/datasets_impact.py
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
def load_data_timeline_surgery() -> Bunch:
    """Load and return the MSK-IMPACT surgical timeline dataset (deidentified).

    Returns:
        data : Dictionary-like object, with the following attributes.

            - **data** : pandas DataFrame
                The data matrix.
            - **description_columns** (Future release) : list
                The names of the dataset columns.
            - **description_dataset** (Future release) : str
                The full description of the dataset.
            - **filename** (Future release) : str
                The path to the location of the data.

    Examples
    --------
    ```python
    from msk_cdm.datasets import connect_to_db
    from msk_cdm.datasets.impact import load_data_timeline_surgery

    # Connect to the database
    auth_file = 'path/to/config.txt'
    connect_to_db(auth_file=auth_file)

    # Load the dataset
    df_timeline_surgery = load_data_timeline_surgery()

    # Access the data
    df_surg = df_timeline_surgery['data']

    # Display the first few rows of the data
    print(df_surg.head())
    ```
    """
    df = _loader._load_impact_data_timeline_surgery()
    output = Bunch(data=df)
    return output