Skip to content

HKH515/edf-loader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python library to load channels in EDF files as dictionaries, with support for train/test set splitting.

Setup

pip3 install -e .

Usage

from Loader import Loader, samplify

loader = Loader("path/to/edf/folder", ["O1-A2"], ["SAO2"])

for x, y in loader.load():
    # do something with data here

x and y will be dictionaries with channel names as the keys. and dictionaries with sampling frequency and data key-value pairs.

x = {
    "eog_l": {"sampling_frequency": 100, "data":[...]},
    "eog_r": {"sampling_frequency": 100, "data":[...]}
}

y = {
    "spo2": {"sampling_frequency": 1, "data": [...]}
}

Samplify:

data = { 
    'eog':{
        'sampling_frequency':2, 
        'data':[1, 2 ,3 ,4, 5, 6]
    }
}
#data contains the channel 'eog' which has a
# 3-second recording of a 2Hz signal(6 samples)
#samplify will split the data into 1 second 
# rercordings
sampled_data = samplify(data, 1)
# sampled_data = {
#     'eog':{
#         'sampling_frequency':2,
#         'data':[[1,2],[3,4],[5,6]]
#     }
# }

About

Python library to load channels in EDF files as a pandas dataframe.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages