docstr: Impute the tsdataset by imputing each univariate time series
  distinguished by id_col and feature_col.
  
  :param mode: imputation mode, select from "last", "const" or "linear".
  
      "last": impute by propagating the last non N/A number to its following N/A.
      if there is no non N/A number ahead, 0 is filled instead.
  
      "const": impute by a const value input by user.
  
      "linear": impute by linear interpolation.
  :param const_num:  indicates the const number to fill, which is only effective when mode
      is set to "const".
  
  :return: the tsdataset instance.
docstr_tok: ["Impute","the","tsdataset","by","imputing","each","univariate","time","series","distinguished","by","id_col","and","feature_col",".",":","param","mode",":","imputation","mode",",","select","from","``","last","''",",","``","const","''","or","``","linear","''",".","``","last","''",":","impute","by","propagating","the","last","non","N\/A","number","to","its","following","N\/A",".","if","there","is","no","non","N\/A","number","ahead",",","0","is","filled","instead",".","``","const","''",":","impute","by","a","const","value","input","by","user",".","``","linear","''",":","impute","by","linear","interpolation",".",":","param","const_num",":","indicates","the","const","number","to","fill",",","which","is","only","effective","when","mode","is","set","to","``","const","''",".",":","return",":","the","tsdataset","instance","."]
code: def impute(self, mode="last", const_num=0):
      """
      Impute the tsdataset by imputing each univariate time series
      distinguished by id_col and feature_col.
  
      :param mode: imputation mode, select from "last", "const" or "linear".
  
          "last": impute by propagating the last non N/A number to its following N/A.
          if there is no non N/A number ahead, 0 is filled instead.
  
          "const": impute by a const value input by user.
  
          "linear": impute by linear interpolation.
      :param const_num:  indicates the const number to fill, which is only effective when mode
          is set to "const".
  
      :return: the tsdataset instance.
      """
      self.df = self.df.groupby([self.id_col]).apply(
          lambda df: impute_timeseries_dataframe(
              df=df, dt_col=self.dt_col, mode=mode, const_num=const_num
          )
      )
      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 4 for calling the TSDataset obj's underlying member method code with example usage: obj.impute(mode, const_num) and returns: self