code: def median(data):
      """Substitute missing values with the median of that column(middle).
  
      Parameters
      ----------
      data: numpy.ndarray
          Data to impute.
  
      Returns
      -------
      numpy.ndarray
          Imputed data.
  
      """
      nan_xy = matrix.nan_indices(data)
      cols_missing = set(nan_xy.T[1])
      medians = {}
      for y_i in cols_missing:
          cols_wo_nan = data[:, [y_i]][~np.isnan(data[:, [y_i]])]
          median_y = np.median(cols_wo_nan)
          medians[str(y_i)] = median_y
      for x_i, y_i in nan_xy:
          data[x_i][y_i] = medians[str(y_i)]
      return data
  
imports: import numpy
  from impyute.ops import matrix
  from impyute.ops import wrapper
label_desc: Use image node_id 2 for calling a global function with example usage: median(data) and returns: data