code: def _filter_variable_indices(mask, column_selection):
      
      a = np.where(mask)[0]
      b = column_selection[np.in1d(column_selection, a)]
      return np.searchsorted(a, b)
docs: Returns column indices restricted to the variable columns as determined by the given mask.
  
      Parameters
      ----------
      mask : ndarray(N, dtype=bool)
          Array indicating the variable columns.
      column_selection : ndarray(k, dtype=int)
          Column indices to be filtered and mapped.
  
      Returns
      -------
      ix : ndarray(l, dtype=int)
          Column indices restricted to the variable columns, mapped to the correct index range.