pandas.api.extensions.ExtensionArray.equals#

ExtensionArray.equals(other)[source]#

Return if another array is equivalent to this array.

Equivalent means that both arrays have the same shape and dtype, and all values compare equal. Missing values in the same location are considered equal (in contrast with normal equality).

Parameters:
otherExtensionArray

Array to compare to this Array.

Returns:
boolean

Whether the arrays are equivalent.

See also

numpy.array_equal

Equivalent method for numpy array.

Series.equals

Equivalent method for Series.

DataFrame.equals

Equivalent method for DataFrame.

Examples

>>> arr1 = pd.array([1, 2, np.nan])
>>> arr2 = pd.array([1, 2, np.nan])
>>> arr1.equals(arr2)
True
>>> arr1 = pd.array([1, 3, np.nan])
>>> arr2 = pd.array([1, 2, np.nan])
>>> arr1.equals(arr2)
False