This is a pre-release version (latest). Go to latest (2.4.4)
{ } Raw JSON

bundles / numpy latest / numpy / array_equiv

_ArrayFunctionDispatcher

numpy:array_equiv

source: /dev/numpy/build-install/usr/lib/python3.14/site-packages/numpy/_core/numeric.py :2612

Signature

def   array_equiv ( a1 a2 )

Summary

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

Extended Summary

Shape consistent means they are either the same shape, or one input array can be broadcasted to create the same shape as the other one.

Parameters

a1, a2 : array_like

Input arrays.

Returns

out : bool

True if equivalent, False otherwise.

Examples

import numpy as np
np.array_equiv([1, 2], [1, 2])
np.array_equiv([1, 2], [1, 3])
Showing the shape equivalence:
np.array_equiv([1, 2], [[1, 2], [1, 2]])
np.array_equiv([1, 2], [[1, 2, 1, 2], [1, 2, 1, 2]])
np.array_equiv([1, 2], [[1, 2], [1, 3]])

Aliases

  • numpy.array_equiv