code: def ecg_find_peaks(signal, sampling_rate=1000):
      
      rpeaks, = biosppy.ecg.hamilton_segmenter(np.array(signal), sampling_rate=sampling_rate)
      rpeaks, = biosppy.ecg.correct_rpeaks(signal=np.array(signal), rpeaks=rpeaks, sampling_rate=sampling_rate, tol=0.05)
      return(rpeaks)
docs: Find R peaks indices on the ECG channel.
  
      Parameters
      ----------
      signal : list or ndarray
          ECG signal (preferably filtered).
      sampling_rate : int
          Sampling rate (samples/second).
  
  
      Returns
      ----------
      rpeaks : list
          List of R-peaks location indices.
  
      Example
      ----------
      >>> import neurokit as nk
      >>> Rpeaks = nk.ecg_find_peaks(signal)
  
      Notes
      ----------
      *Authors*
  
      - the bioSSPy dev team (https://github.com/PIA-Group/BioSPPy)
  
      *Dependencies*
  
      - biosppy
  
      *See Also*
  
      - BioSPPY: https://github.com/PIA-Group/BioSPPy