From f39354cb686710f8e243e214b94fda0914fff656 Mon Sep 17 00:00:00 2001 From: Bernd Porr Date: Mon, 26 Feb 2024 07:40:18 +0000 Subject: [PATCH] Prevent crash when array is not a numpy array. @Catriix pointed out that the np.where command only works with numpy arrays so converting the RR sample pos into an np array. --- hrv.py | 1 + 1 file changed, 1 insertion(+) diff --git a/hrv.py b/hrv.py index a5f3854..2081064 100644 --- a/hrv.py +++ b/hrv.py @@ -116,6 +116,7 @@ def SDANN(self, rr_samples, average_period=5.0, normalise=False): average_period_samples = int(self.fs*average_period*60) average_rr_intervals = [] + rr_samples = np.array(rr_samples) sections = int((np.max(rr_samples)/average_period_samples)+0.5)