Skip to content

load_pathology_reports_idb

Load and return the IDB pathology reports 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_pathology_reports_idb

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

# Load the dataset
df_pathology_reports = load_pathology_reports_idb()

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

# Display the first few rows of the data
print(df.head())
Source code in msk_cdm/datasets/phi/idb/datasets_phi_idb.py
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
def load_pathology_reports_idb() -> Bunch:
    """Load and return the IDB pathology reports 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_pathology_reports_idb

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

    # Load the dataset
    df_pathology_reports = load_pathology_reports_idb()

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

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