Check that left and right ExtensionArrays are equal.
The two arrays to compare.
Whether to check if the ExtensionArray dtypes are identical.
Optional index (shared by both left and right), used in output.
Whether to compare number exactly.
Changed in version 2.2.0: Defaults to True for integer dtypes if none of check_exact, rtol and atol are specified.
Relative tolerance. Only used when check_exact is False.
Absolute tolerance. Only used when check_exact is False.
Specify object name being compared, internally used to show appropriate assertion message.
Added in version 2.0.0.
Notes
Missing values are checked separately from valid values. A mask of missing values is computed for each and checked to match. The remaining all-valid values are cast to object dtype and checked.
Examples
>>> from pandas import testing as tm
>>> a = pd.Series([1, 2, 3, 4])
>>> b, c = a.array, a.array
>>> tm.assert_extension_array_equal(b, c)
© 2008–2011, AQR Capital Management, LLC, Lambda Foundry, Inc. and PyData Development Team
© 2011–2025, Open source contributors
Licensed under the 3-clause BSD License.
https://pandas.pydata.org/pandas-docs/version/2.3.0/reference/api/pandas.testing.assert_extension_array_equal.html