docstr: Resample on a new interval for each univariate time series distinguished
  by id_col and feature_col.
  
  :param interval: pandas offset aliases, indicating time interval of the output dataframe.
  :param start_time: start time of the output dataframe.
  :param end_time: end time of the output dataframe.
  :param merge_mode: if current interval is smaller than output interval,
      we need to merge the values in a mode. "max", "min", "mean"
      or "sum" are supported for now.
  
  :return: the tsdataset instance.
docstr_tok: ["Resample","on","a","new","interval","for","each","univariate","time","series","distinguished","by","id_col","and","feature_col",".",":","param","interval",":","pandas","offset","aliases",",","indicating","time","interval","of","the","output","dataframe",".",":","param","start_time",":","start","time","of","the","output","dataframe",".",":","param","end_time",":","end","time","of","the","output","dataframe",".",":","param","merge_mode",":","if","current","interval","is","smaller","than","output","interval",",","we","need","to","merge","the","values","in","a","mode",".","``","max","''",",","``","min","''",",","``","mean","''","or","``","sum","''","are","supported","for","now",".",":","return",":","the","tsdataset","instance","."]
code: def resample(
      self, interval, start_time=None, end_time=None, merge_mode="mean"
  ):
      """
      Resample on a new interval for each univariate time series distinguished
      by id_col and feature_col.
  
      :param interval: pandas offset aliases, indicating time interval of the output dataframe.
      :param start_time: start time of the output dataframe.
      :param end_time: end time of the output dataframe.
      :param merge_mode: if current interval is smaller than output interval,
          we need to merge the values in a mode. "max", "min", "mean"
          or "sum" are supported for now.
  
      :return: the tsdataset instance.
      """
      assert (
          self._is_pd_datetime
      ), "The time series data does not have a Pandas datetime format\
              (you can use pandas.to_datetime to convert a string into a datetime format)."
      from pandas.api.types import is_numeric_dtype
  
      type_error_list = [
          val
          for val in self.target_col + self.feature_col
          if not is_numeric_dtype(self.df[val])
      ]
      try:
          for val in type_error_list:
              self.df[val] = self.df[val].astype(np.float32)
      except Exception:
          raise RuntimeError(
              "All the columns of target_col"
              "and extra_feature_col should be of numeric type."
          )
      self.df = self.df.groupby([self.id_col]).apply(
          lambda df: resample_timeseries_dataframe(
              df=df,
              dt_col=self.dt_col,
              interval=interval,
              start_time=start_time,
              end_time=end_time,
              id_col=self.id_col,
              merge_mode=merge_mode,
          )
      )
      self._freq = pd.Timedelta(interval)
      self._freq_certainty = True
      self.df.reset_index(drop=True, inplace=True)
      return self
  
imports: import pandas
  import numpy
  import functools
  from zoo.chronos.data.utils.feature import generate_dt_features, generate_global_features
  from zoo.chronos.data.utils.impute import impute_timeseries_dataframe
  from zoo.chronos.data.utils.deduplicate import deduplicate_timeseries_dataframe
  from zoo.chronos.data.utils.roll import roll_timeseries_dataframe
  from zoo.chronos.data.utils.scale import unscale_timeseries_numpy
  from zoo.chronos.data.utils.resample import resample_timeseries_dataframe
  from zoo.chronos.data.utils.split import split_timeseries_dataframe
  from zoo.chronos.data.utils.utils import _to_list, _check_type, _check_col_within, _check_col_no_na, _check_is_aligned, _check_dt_is_sorted
  from tsfresh.utilities.dataframe_functions import roll_time_series
  from tsfresh.utilities.dataframe_functions import impute
  from tsfresh import extract_features
  from tsfresh.feature_extraction import ComprehensiveFCParameters, MinimalFCParameters, EfficientFCParameters
label_desc: Use image node_id 6 for calling the TSDataset obj's underlying member method code with example usage: obj.resample(interval, start_time, end_time, merge_mode) and returns: self