code: def count_peaks(ts):
      
  
      on_toggles = ts.diff() > 3000
      shifted = np.logical_not(on_toggles.shift(1))
      result = on_toggles & shifted
      count = result.sum()
      return count
docs: Toggle counter for gas boilers
  
      Counts the number of times the gas consumption increases with more than 3kW
  
      Parameters
      ----------
      ts: Pandas Series
          Gas consumption in minute resolution
  
      Returns
      -------
      int