code: def merge_time_series(data, fs_resample, time_unit):
      """Time series data interpolation
  
      Parameters
      ----------
      data : dict
          data to interpolate
      fs_resample :
          resample sampling frequency
      time_unit :
          time unit in seconds
  
      Returns
      -------
      DataFrame
          Interpolated data
  
      """
  
      # time interval for interpolation
      sensors_time = np.array(
          [[dn.iloc[0, 0], dn.iloc[-1, 0]] for k, dn in data.items()]
      )
      t0 = np.max(sensors_time[:, 0])
      tn = np.min(sensors_time[:, 1])
      x_new = np.linspace(
          t0, tn, int((tn - t0) / ((1 / fs_resample) * time_unit))
      )
  
      # interpolation
      data_new = np.copy(x_new.reshape(len(x_new), 1))
      header_values = ["time"]
      for k, dn in data.items():
          header_values += [
              k + str(i) for i in range(1, np.shape(dn)[1])
          ]
          data_new = np.hstack(
              (
                  data_new,
                  np.array(
                      [
                          interp1d(dn.iloc[:, 0], dn.iloc[:, ax])(x_new)
                          for ax in range(1, np.shape(dn)[1])
                      ]
                  ).T,
              )
          )
  
      return pd.DataFrame(
          data=data_new[:, 1:], columns=header_values[1:]
      )
  
imports: import numpy
  import pandas
  from scipy.interpolate import interp1d
label_desc: Use image node_id 2 for calling a global function with example usage: merge_time_series(data, fs_resample, time_unit) and returns: pd