Skip to content

eds_scikit.io.files

PandasData

PandasData(folder: str)

Bases: BaseData

Pandas interface to OMOP data stored as local parquet files/folders.

PARAMETER DESCRIPTION
folder

absolute path to a folder containing several parquet files with OMOP data

TYPE: str

Examples:

>>> data = PandasData(folder="/export/home/USER/my_data/")
>>> person = data.person
>>> person.shape
(100, 10)
Source code in eds_scikit/io/files.py
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
def __init__(
    self,
    folder: str,
):
    """Pandas interface to OMOP data stored as local parquet files/folders.


    Parameters
    ----------
    folder: str
        absolute path to a folder containing several parquet files with OMOP data

    Examples
    --------
    >>> data = PandasData(folder="/export/home/USER/my_data/")
    >>> person = data.person
    >>> person.shape
    (100, 10)

    """
    super().__init__()
    self.folder = folder
    self.available_tables = self.list_available_tables()
    self.tables_paths = self.get_table_path()
    if not self.available_tables:
        raise ValueError(f"Folder {folder} does not contain any parquet omop data.")
Back to top