Code Monkey home page Code Monkey logo

Comments (5)

dpodvyaznikov avatar dpodvyaznikov commented on June 5, 2024 1

Great, thank you!

The problem is that you use fmt='wf' instead of fmt='wfdb' in load function. 'wfdb' is the proper value here to use for the wfdb files.

An error about the format should've been raised when you passed wrong value, I'll look into the reasons why it did not.

from cardio.

dpodvyaznikov avatar dpodvyaznikov commented on June 5, 2024

Hi, @Myles-JB !

Please provide the code that caused the error including the code you used to create and process sample object you've mentioned.

This error might appear in case you create an EcgBatch object and do not use load action to load the signals into it, but it's hard to tell without the code.

from cardio.

Myles-JB avatar Myles-JB commented on June 5, 2024

Hi @dpodvyaznikov,
Thanks for getting back!
Below is the code that I have been using including imports etc.

import matplotlib.pyplot as plt
import pandas as pd
import wfdb as wf
import cardio
import cardio.batchflow as bf 
from cardio import EcgDataset
from cardio import EcgBatch

import sys
pathToDataSet = "physionet.org/physiobank/database/afdb/*.hea"
pathToRefCSV = "physionet.org/physiobank/database/afdb/REFERENCE.csv"
dataset = EcgDataset(path=pathToDataSet, no_ext=True, sort=True)

batch = dataset.next_batch(batch_size=6, unique_labels=['A', 'N', 'O'])

sample = batch.load(fmt='wf', components=['signal', 'meta'])

sample = sample.load(src = pathToRefCSV, fmt='csv', components='target' )
sample.show_ecg('A00001')

from cardio.

Myles-JB avatar Myles-JB commented on June 5, 2024

Amazing!
Thanks for your help!

from cardio.

dpodvyaznikov avatar dpodvyaznikov commented on June 5, 2024

Fixed in #23
Closing this issue.

from cardio.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.