docs: def number_peaks(x, n):
      """
      Calculates the number of peaks of at least support n in the time series x. A peak of support n is defined as a
      subsequence of x where a value occurs, which is bigger than its n neighbours to the left and to the right.
  
      Hence in the sequence
  
      >>> x = [3, 0, 0, 4, 0, 0, 13]
  
      4 is a peak of support 1 and 2 because in the subsequences
  
      >>> [0, 4, 0]
      >>> [0, 0, 4, 0, 0]
  
      4 is still the highest value. Here, 4 is not a peak of support 3 because 13 is the 3th neighbour to the right of 4
      and its bigger than 4.
  
      :param x: the time series to calculate the feature of
      :type x: numpy.ndarray
      :param n: the support of the peak
      :type n: int
      :return: the value of this feature
      :return type: float
      """
      x_reduced = x[n:-n]
  
      res = None
      for i in range(1, n + 1):
          result_first = (x_reduced > _roll(x, i)[n:-n])
  
          if res is None:
              res = result_first
          else:
              res &= result_first
  
          res &= (x_reduced > _roll(x, -i)[n:-n])
      return np.sum(res)