def assert_numpy_array_equal(left, right,
                             strict_nan=False, err_msg=None,
                             obj='numpy array'):
    """Checks that 'np_array' is equivalent to 'assert_equal'.

    This is similar to ``numpy.testing.assert_array_equal``, but can
    check equality including ``np.nan``. Two numpy arrays are regarded as
    equivalent if the arrays have equal non-NaN elements,
    and `np.nan` in corresponding locations.
    """

    # compare shape and values
    if array_equivalent(left, right, strict_nan=strict_nan):
        return True

    if err_msg is None:
        # show detailed error

        if lib.isscalar(left) and lib.isscalar(right):
            # show scalar comparison error
            assert_equal(left, right)
        elif is_list_like(left) and is_list_like(right):
            # some test cases pass list
            left = np.asarray(left)
            right = np.array(right)

            if left.shape != right.shape:
                raise_assert_detail(obj, '{0} shapes are different'
                                    .format(obj), left.shape, right.shape)

            diff = 0
            for l, r in zip(left, right):
                # count up differences
                if not array_equivalent(l, r, strict_nan=strict_nan):
                    diff += 1

            diff = diff * left.size / 100.0
            msg = '{0} values are different ({1} %)'\
                .format(obj, np.round(diff, 5))
            raise_assert_detail(obj, msg, left, right)
        elif is_list_like(left):
            msg = "First object is iterable, second isn't"
            raise_assert_detail(obj, msg, left, right)
        else:
            msg = "Second object is iterable, first isn't"
            raise_assert_detail(obj, msg, left, right)

    raise AssertionError(err_msg)


# This could be refactored to use the NDFrame.equals method
dataset/ETHPy150Open pydata/pandas/pandas/util/testing.py/assert_numpy_array_equal/swapped operands of `/`