Skip to content

load_surgeries_idb

Load and return the IDB surgeries dataset (PHI).

Returns:

Name Type Description
data Bunch

Dictionary-like object, with the following attributes.

  • data : pandas DataFrame The data matrix.

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_surgeries_idb

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

# Load the dataset
df_surgeries = load_surgeries_idb()

# Access the data
df = df_surgeries['data']

# Display the first few rows of the data
print(df.head())
Source code in msk_cdm/datasets/phi/idb/datasets_phi_idb.py
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
def load_surgeries_idb() -> Bunch:
    """Load and return the IDB surgeries dataset (PHI).

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

            - **data** : pandas DataFrame
                The data matrix.

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

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

    # Load the dataset
    df_surgeries = load_surgeries_idb()

    # Access the data
    df = df_surgeries['data']

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