class_docstr: Variable-wise aggregate of multivariate kernel or distance function.
  
  A common baseline method to turn a univariate time series distance or kernel
  into a multivariate time series distance or kernel.
  
  Also sometimes known as "independent distance" in the special case where `aggfun`
  is the sum or mean and the pairwise transformer is a time series distance.
  
  Formal details (for real valued objects, mixed typed rows in analogy):
  Let :math:`d: \mathbb{R}^n \times \mathbb{R}^n\rightarrow \mathbb{R}`
  be the pairwise function in `dist`, when applied to univariate series of length
  :math:`n`.
  This class represents the pairwise function
  :math:`d_g: \mathbb{R}^{n\times D} \times \mathbb{R}^{n\times D}\rightarrow \mathbb{R}`
  defined as :math:`d_g(x, y) := g(d(x_1, y_1), \dots, d(x_D, y_D))`,
  where :math:`x_i`, :math:`y_i` denote the :math:`i`-th column,
  and :math:`x`, `:math:`y` are interpreted as multivariate time series with
  :math:`D` variables, and where :math:`g` is a function
  :math:`g: \mathbb{R}^D\times \mathbb{R}^D \rightarrow \mathbb{R}`,
  representing the input `aggfun`.
  
  In particular, if `aggfun="sum"` (or default), then
  :math:`g(x) = \sum_{i=1}^D x_i`, and
  :math:`d_g(x, y) := \sum_{i=1}^D d(x_i, y_i)`,
  which corresponds to the usual terminology "independent distance".
  
  Parameters
  ----------
  dist : pairwise transformer of BasePairwiseTransformer scitype, or
      callable np.ndarray (n_samples, nd) x (n_samples, nd) -> (n_samples x n_samples)
  aggfun : optional, str or callable np.ndarray (m, nd, nd) -> (nd, nd)
      aggregation function over the variables, :math:`g` above
      "sum" = np.sum = default
      "mean" = np.mean
      "median" = np.median
      "max" = np.max
      "min" = np.min
      when starting with a function (m) -> scalar, use np.apply_along_axis
      to create a function (m, nd, nd) -> (nd, nd) and pass that as `aggfun`
  
  Examples
  --------
  >>> from sktime.dists_kernels.indep import IndepDist
  >>> from sktime.dists_kernels.dtw import DtwDist
  >>>
  >>> dist = IndepDist(DtwDist())
docstr: Compute distance/kernel matrix.
  
  private _transform containing core logic, called from public transform
  
  Parameters
  ----------
  X: sktime Panel data container
  X2: sktime Panel data container
  
  Returns
  -------
  distmat: np.array of shape [n, m]
      (i,j)-th entry contains distance/kernel between X.iloc[i] and X2.iloc[j]
docstr_tok: ["Compute","distance\/kernel","matrix",".","private","_transform","containing","core","logic",",","called","from","public","transform","Parameters","--","--","--","--","--","X",":","sktime","Panel","data","container","X2",":","sktime","Panel","data","container","Returns","--","--","--","-","distmat",":","np.array","of","shape","[","n",",","m","]","(","i",",","j",")","-th","entry","contains","distance\/kernel","between","X.iloc","[","i","]","and","X2.iloc","[","j","]"]
code: def _transform(self, X, X2=None):
      """Compute distance/kernel matrix.
  
      private _transform containing core logic, called from public transform
  
      Parameters
      ----------
      X: sktime Panel data container
      X2: sktime Panel data container
  
      Returns
      -------
      distmat: np.array of shape [n, m]
          (i,j)-th entry contains distance/kernel between X.iloc[i] and X2.iloc[j]
      """
      dist = self.dist
      aggfun = self._aggfun
  
      mats = []
      for col in X.columns:
          X_sub = X.loc[:, [col]]
          if X2 is None:
              X2_sub = None
          else:
              X2_sub = X2.loc[:, [col]]
          mats += [dist.transform(X_sub, X2_sub)]
  
      if isinstance(self.aggfun, str) or self.aggfun is None:
          distmat = aggfun(mats, axis=0)
      else:
          distmat = aggfun(mats)
      return distmat
  
imports: import numpy
  from sktime.dists_kernels.base import BasePairwiseTransformerPanel
label_desc: Use image node_id 2 for calling the IndepDist obj's underlying member method code with example usage: obj._transform(X, X2) and returns: distmat