Closed andbiz closed 7 years ago
Error 2: manage the absence of a signal Error 1: manage out of bound indexes in segmentation
New error:
#label based windowing
label_based = ph.LabelSegments(labels = label)
result, labels, col_names = ph.fmap(label_based(ibi), indicators)
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-45-5b39f6669d82> in <module>()
2 label_based = ph.LabelSegments(labels = label)
3
----> 4 result, labels, col_names = ph.fmap(label_based(ibi), indicators)
/home/andrea/Trento/CODICE/workspaces/pyHRV/pyHRV/pyphysio/__init__.pyc in fmap(segments, algorithms, alt_signal)
136 from numpy import asarray as _asarray
137 values = _asarray([[seg.get_begin_time(), seg.get_end_time()] + [alg(seg(alt_signal)) for alg in algorithms]
--> 138 for seg in segments])
139 labels = _asarray([seg.get_label() for seg in segments])
140 col_names = ["begin", "end"] + map(lambda x: x.__repr__(), algorithms)
/home/andrea/Trento/CODICE/workspaces/pyHRV/pyHRV/pyphysio/BaseSegmentation.pyc in next(self)
121
122 def next(self):
--> 123 return self._win.next_segment()
124
125
/home/andrea/Trento/CODICE/workspaces/pyHRV/pyHRV/pyphysio/segmentation/SegmentsGenerators.py in next_segment(self)
27 raise StopIteration()
28
---> 29 b, e, label = self.next_segment_mix_labels()
30 s = Segment(b, e, label, self._signal)
31 return s
/home/andrea/Trento/CODICE/workspaces/pyHRV/pyHRV/pyphysio/segmentation/SegmentsGenerators.py in next_segment_mix_labels(self)
90 # Check if classically mixed
91 # compare with first each label in [b+1, e)
---> 92 for i in range(first + 1, last):
93 if label != self._labsig[i]:
94 # This is a mixed segment
TypeError: range() integer end argument expected, got float.