class_docstr: The Missing Values Dispersion visualizer shows the locations of missing (nan)
  values in the feature dataset by the order of the index.
  
  When y targets are supplied to fit, the output dispersion plot is color
  coded according to the target y that the element refers to.
  
  Parameters
  ----------
  alpha : float, default: 0.5
      A value for bending elments with the background.
  
  marker : matplotlib marker, default: |
      The marker used for each element coordinate in the plot
  
  classes : list, default: None
      A list of class names for the legend.
      If classes is None and a y value is passed to fit then the classes
      are selected from the target vector.
  
  kwargs : dict
      Keyword arguments that are passed to the base class and may influence
      the visualization as defined in other Visualizers.
  
  Attributes
  ----------
  features_ : np.array
      The feature labels ranked according to their importance
  
  classes_ : np.array
      The class labels for each of the target values
  
  Examples
  --------
  
  >>> from yellowbrick.contrib.missing import MissingValuesDispersion
  >>> visualizer = MissingValuesDispersion()
  >>> visualizer.fit(X, y=y)
  >>> visualizer.show()
docstr: Gets the locations of nans in feature data and returns
  the coordinates in the matrix
docstr_tok: ["Gets","the","locations","of","nans","in","feature","data","and","returns","the","coordinates","in","the","matrix"]
code: def get_nan_locs(self, **kwargs):
      """Gets the locations of nans in feature data and returns
      the coordinates in the matrix
      """
      if np.issubdtype(self.X.dtype, np.string_) or np.issubdtype(
          self.X.dtype, np.unicode_
      ):
          mask = np.where(self.X == "")
          nan_matrix = np.zeros(self.X.shape)
          nan_matrix[mask] = np.nan
  
      else:
          nan_matrix = self.X.astype(float)
  
      if self.y is None:
          return np.argwhere(np.isnan(nan_matrix))
      else:
          nan_locs = []
          for target_value in np.unique(self.y):
              indices = np.argwhere(self.y == target_value)
              target_matrix = nan_matrix[indices.flatten()]
              nan_target_locs = np.argwhere(np.isnan(target_matrix))
              nan_locs.append((target_value, nan_target_locs))
  
          return nan_locs
  
file_path: yellowbrick/yellowbrick/contrib/missing/dispersion.py
imports: import numpy
  from yellowbrick.style.palettes import color_palette
  from .base import MissingDataVisualizer
label_desc: Use image node_id 2 for calling the MissingValuesDispersion obj's underlying member method code with example usage: obj.get_nan_locs() and returns: np, nan_locs