class_docstr: Perform approximate comparisons where the expected value is numpy array.
class_docstr_tok: ["Perform","approximate","comparisons","where","the","expected","value","is","numpy","array","."]
code: def _yield_comparisons(self, actual):
      import numpy as np
  
      # `actual` can either be a numpy array or a scalar, it is treated in
      # `__eq__` before being passed to `ApproxBase.__eq__`, which is the
      # only method that calls this one.
  
      if np.isscalar(actual):
          for i in np.ndindex(self.expected.shape):
              yield actual, self.expected[i].item()
      else:
          for i in np.ndindex(self.expected.shape):
              yield actual[i].item(), self.expected[i].item()
  
imports: from __future__ import absolute_import
  import math
  import pprint
  import sys
  import warnings
  from decimal import Decimal
  from numbers import Number
  from more_itertools.more import always_iterable
  from six.moves import filterfalse
  from six.moves import zip
  import _pytest._code
  from _pytest import deprecated
  from _pytest.compat import isclass
  from _pytest.compat import Iterable
  from _pytest.compat import Mapping
  from _pytest.compat import Sized
  from _pytest.compat import STRING_TYPES
  from _pytest.outcomes import fail
label_desc: Use image node_id 3 for calling the ApproxNumpy obj's underlying member method code with example usage: obj._yield_comparisons(actual) without return types