Skip to content

load_data_timeline_tumor_sites

Load and return the MSK-IMPACT tumor sites 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_tumor_sites

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

# Load the dataset
df_timeline_tumor_sites = load_data_timeline_tumor_sites()

# Access the data
df_tumor_sites = df_timeline_tumor_sites['data']

# Display the first few rows of the data
print(df_tumor_sites.head())
Source code in msk_cdm/datasets/impact/datasets_impact.py
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
def load_data_timeline_tumor_sites() -> Bunch:
    """Load and return the MSK-IMPACT tumor sites 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_tumor_sites

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

    # Load the dataset
    df_timeline_tumor_sites = load_data_timeline_tumor_sites()

    # Access the data
    df_tumor_sites = df_timeline_tumor_sites['data']

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