docs: def group_by_interpolate(df, x=None, y=None, group_by=None,
                           number_of_points=100, tidy=False,
                           individual_x_cols=False, header_name="Unit",
                           dx=10.0, generate_new_x=True):
      """Use this for generating wide format from long (tidy) data"""
  
      time_00 = time.time()
      if x is None:
          x = HEADERS_NORMAL.step_time_txt
      if y is None:
          y = HEADERS_NORMAL.voltage_txt
      if group_by is None:
          group_by = [HEADERS_NORMAL.cycle_index_txt]
  
      if not isinstance(group_by, (list, tuple)):
          group_by = [group_by]
  
      if not generate_new_x:
          # check if it makes sence
          if (not tidy) and (not individual_x_cols):
              logging.warning("Unlogical condition")
              generate_new_x = True
  
      new_x = None
  
      if generate_new_x:
          x_max = df[x].max()
          x_min = df[x].min()
          if number_of_points:
              new_x = np.linspace(x_max, x_min, number_of_points)
          else:
              new_x = np.arange(x_max, x_min, dx)
  
      new_dfs = []
      keys = []
  
      for name, group in df.groupby(group_by):
          keys.append(name)
          if not isinstance(name, (list, tuple)):
              name = [name]
  
          new_group = _interpolate_df_col(
              group, x=x, y=y, new_x=new_x,
              number_of_points=number_of_points,
              dx=dx,
          )
  
          if tidy or (not tidy and not individual_x_cols):
              for i, j in zip(group_by, name):
                  new_group[i] = j
          new_dfs.append(new_group)
  
      if tidy:
          new_df = pd.concat(new_dfs)
      else:
          if individual_x_cols:
              new_df = pd.concat(new_dfs, axis=1, keys=keys)
              group_by.append(header_name)
              new_df.columns.names = group_by
          else:
              new_df = pd.concat(new_dfs)
              new_df = new_df.pivot(index=x, columns=group_by[0], values=y, )
      self.logger.debug(f"(dt: {(time.time() - time_00):4.2f}s)")
      return new_df