Skip to content

load_data_timeline_ecog_kps

Load and return the MSK-IMPACT ECOG-KPS 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_ecog_kps

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

# Load the dataset
df_timeline_ecog_kps = load_data_timeline_ecog_kps()

# Access the data
df_ecog_kps = df_timeline_ecog_kps['data']

# Display the first few rows of the data
print(df_ecog_kps.head())
Source code in msk_cdm/datasets/impact/datasets_impact.py
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
def load_data_timeline_ecog_kps() -> Bunch:
    """Load and return the MSK-IMPACT ECOG-KPS 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_ecog_kps

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

    # Load the dataset
    df_timeline_ecog_kps = load_data_timeline_ecog_kps()

    # Access the data
    df_ecog_kps = df_timeline_ecog_kps['data']

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