Skip to content

Commit

Permalink
Prevent crash when array is not a numpy array.
Browse files Browse the repository at this point in the history
@Catriix pointed out that the np.where command only works with
numpy arrays so converting the RR sample pos into an np array.
  • Loading branch information
berndporr committed Feb 26, 2024
1 parent c41b16f commit f39354c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions hrv.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit f39354c

Please sign in to comment.