numpy 1.22.4 Pypi GitHub Homepage
Other Docs
ParametersReturnsBackRef
array_equal(a1, a2, equal_nan=False)

Parameters

a1, a2 : array_like

Input arrays.

equal_nan : bool

Whether to compare NaN's as equal. If the dtype of a1 and a2 is complex, values will be considered equal if either the real or the imaginary component of a given value is nan .

versionadded

Returns

b : bool

Returns True if the arrays are equal.

True if two arrays have the same shape and elements, False otherwise.

See Also

allclose

Returns True if two arrays are element-wise equal within a tolerance.

array_equiv

Returns True if input arrays are shape consistent and all elements equal.

Examples

>>> np.array_equal([1, 2], [1, 2])
True
>>> np.array_equal(np.array([1, 2]), np.array([1, 2]))
True
>>> np.array_equal([1, 2], [1, 2, 3])
False
>>> np.array_equal([1, 2], [1, 4])
False
>>> a = np.array([1, np.nan])
... np.array_equal(a, a) False
>>> np.array_equal(a, a, equal_nan=True)
True

When equal_nan is True, complex values with nan components are considered equal if either the real or the imaginary components are nan.

>>> a = np.array([1 + 1j])
... b = a.copy()
... a.real = np.nan
... b.imag = np.nan
... np.array_equal(a, b, equal_nan=True) True
See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

numpy.allclose scipy.signal._bsplines.cubic scipy.signal._bsplines.quadratic dask.array.routines.insert scipy.optimize._qap.quadratic_assignment scipy.signal._bsplines.bspline dask.array.creation.meshgrid pandas.core.generic.NDFrame.equals

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


GitHub : /numpy/core/numeric.py#2388
type: <class 'function'>
Commit: