Skip to content

How to use PTB Diagnostic ECG Database on Neurokit 2 #508

Answered by zen-juen
as1123000 asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @as1123000 how does your script for downloading the PTB database with neurokit look like?
In the meantime, perhaps you can try out this short script for the ptbdb 1.0.0 database


import pandas as pd
import numpy as np
import wfdb
import os

# set working directory first
wd = os.getcwd()

patient_files = [file for file in os.listdir("ptb-diagnostic-ecg-database-1.0.0/") if 'patient' in file]

data_files = []
for participant in patient_files:
    path = wd + "\\ptb-diagnostic-ecg-database-1.0.0\\" + participant
    filename = [i for i in os.listdir(path) if ".dat" in i][0]
    file = path + "\\" + filename

    # get signal
    data = pd.DataFrame()
    for i in range(15):
        signal…

Replies: 3 comments 6 replies

Comment options

You must be logged in to vote
5 replies
@as1123000
Comment options

@zen-juen
Comment options

@as1123000
Comment options

@zen-juen
Comment options

@as1123000
Comment options

Answer selected by DominiqueMakowski
Comment options

You must be logged in to vote
1 reply
@DominiqueMakowski
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants