Skip to content

load_data_timeline_gleason

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

Returns:

Name Type Description
data Bunch

Dictionary-like object, with the following attributes.

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

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_gleason

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

# Load the dataset
df_timeline_gleason = load_data_timeline_gleason()

# Access the data
df_gleason = df_timeline_gleason['data']

# Display the first few rows of the data
print(df_gleason.head())
Source code in msk_cdm/datasets/impact/datasets_impact.py
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
def load_data_timeline_gleason() -> Bunch:
    """Load and return the MSK-IMPACT Gleason score timeline dataset (deidentified).

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

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

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

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

    # Load the dataset
    df_timeline_gleason = load_data_timeline_gleason()

    # Access the data
    df_gleason = df_timeline_gleason['data']

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