pandas.testing.assert_extension_array_equal

pandas 3.1.1 · Testing, errors, and warnings · function

Raise AssertionError when two extension arrays fail the equality checks.

Call syntax

pd.testing.assert_extension_array_equal(…) Full signature
pd.testing.assert_extension_array_equal(
    left,
    right,
    check_dtype=True,
    index_values=None,
    check_exact=…,
    rtol=…,
    atol=…,
    obj='ExtensionArray',
)

Run the example

Edit the example and select Run Python to see the result.

Parameters

ParameterRequirementAccepted values and behavior
left Required
Positional or keyword
ExtensionArray

Supply the left-hand input or the left endpoint of the interval.

right Required
Positional or keyword
ExtensionArray

Supply the right-hand input or the right endpoint of the interval.

check_dtype Optional
Positional or keyword
Default True
bool

Choose whether a test requires the two dtypes to match.

index_values Optional
Positional or keyword
Default None
Index | numpy.ndarray
check_exact Optional
Positional or keyword
bool

Choose whether numeric equality tests require exact values.

rtol Optional
Positional or keyword
float

Set the acceptable relative difference in a numeric equality check.

atol Optional
Positional or keyword
float

Set the acceptable absolute difference in a numeric equality check.

obj Optional
Positional or keyword
Default 'ExtensionArray'
str

Provide the pandas object, scalar, or array-like input described in the accepted values.

Returns

None when the checks pass. Raises AssertionError when they fail.