class_docstr: The MissingValues Bar visualizer creates a bar graph that lists the total
  count of missing values for each selected feature column.
  
  When y targets are supplied to fit, the output is a stacked bar chart where
  each color corresponds to the total NaNs for the feature in that column.
  
  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
  
  color : string, default: black
      The color for drawing the bar chart when the y targets are not passed to
      fit.
  
  colors : list, default: None
      The color palette for drawing a stack bar chart when the y targets
      are passed to fit.
  
  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 MissingValuesBar
  >>> visualizer = MissingValuesBar()
  >>> visualizer.fit(X, y=y)
  >>> visualizer.show()
code: def get_nan_col_counts(self, **kwargs):
      if np.issubdtype(self.X.dtype, np.floating) or np.issubdtype(
          self.X.dtype, np.integer
      ):
          nan_matrix = self.X.astype(np.float64)
      else:
          # where matrix contains strings, handle them
          mask = np.where((self.X == "") | (self.X == "nan"))
          nan_matrix = np.zeros(self.X.shape)
          nan_matrix[mask] = np.nan
  
      if self.y is None:
          nan_col_counts = [
              np.count_nonzero(np.isnan(col)) for col in nan_matrix.T
          ]
          return nan_col_counts
  
      else:
          # add in counting of np.nan per target y by column
          nan_counts = []
          for target_value in np.unique(self.y):
              indices = np.argwhere(self.y == target_value)
              target_matrix = nan_matrix[indices.flatten()]
              nan_col_counts = np.array(
                  [
                      np.count_nonzero(np.isnan(col))
                      for col in target_matrix.T
                  ]
              )
              nan_counts.append((target_value, nan_col_counts))
          return nan_counts
  
file_path: yellowbrick/yellowbrick/contrib/missing/bar.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 MissingValuesBar obj's underlying member method code with example usage: obj.get_nan_col_counts() and returns: nan_col_counts, nan_counts