class_docstr: A sampler that uses an underlying training set to draw records that have a subset of features with
  values specified in an instance to be explained, `X`. 
class_docstr_tok: ["A","sampler","that","uses","an","underlying","training","set","to","draw","records","that","have","a","subset","of","features","with","values","specified","in","an","instance","to","be","explained",",","`","X","`","."]
docstr: Create a mapping where key is feat. col ID. and value is a dict where each int represents a bin value
  or value of categorical variable. Each value in this dict is an array of training data rows where that
  value is found.
  
  Returns
  -------
  val2idx
      Mapping as described above.
code: def _get_data_index(self) -> Dict[int, DefaultDict[int, np.ndarray]]:
      """
      Create a mapping where key is feat. col ID. and value is a dict where each int represents a bin value
      or value of categorical variable. Each value in this dict is an array of training data rows where that
      value is found.
  
      Returns
      -------
      val2idx
          Mapping as described above.
      """
  
      all_features = self.numerical_features + self.categorical_features
      val2idx: Dict[int, DefaultDict[int, np.ndarray]] = {
          f_id: defaultdict(None) for f_id in all_features
      }
      for feat in val2idx:
          for value in range(len(self.feature_values[feat])):
              val2idx[feat][value] = (
                  self.d_train_data[:, feat] == value
              ).nonzero()[0]
  
      return val2idx
  
imports: import copy
  from collections import OrderedDict, defaultdict
  from itertools import accumulate
  from typing import Any, Callable, DefaultDict, Dict, List, Optional, Set, Tuple, Type, Union
  import numpy
  from alibi.api.defaults import DEFAULT_DATA_ANCHOR, DEFAULT_META_ANCHOR
  from alibi.api.interfaces import Explainer, Explanation, FitMixin
  from alibi.exceptions import NotFittedError, PredictorCallError, PredictorReturnTypeError
  from alibi.utils.discretizer import Discretizer
  from alibi.utils.mapping import ohe_to_ord, ord_to_ohe
  from alibi.utils.wrappers import ArgmaxTransformer
  from .anchor_base import AnchorBaseBeam
  from .anchor_explanation import AnchorExplanation
label_desc: Use image node_id 8 for calling the TabularSampler obj's underlying member method code with example usage: obj._get_data_index() and returns: val2idx