In order to segment an ECG, we need to specify how many cycles we want to segment. Using neurokit2 to get peaks if we choose to segment into 3 cycles, we have to go through each 4 peaks. But for each 3 cycles we get an error. To resolve this error we have to divide len(ecg) by sample_rate instead of multiplying it with 1/sample_rate.
In order to segment an ECG, we need to specify how many cycles we want to segment. Using neurokit2 to get peaks if we choose to segment into 3 cycles, we have to go through each 4 peaks. But for each 3 cycles we get an error. To resolve this error we have to divide len(ecg) by sample_rate instead of multiplying it with 1/sample_rate.