Check that left and right Index are equal.
Whether to check the Index class, dtype and inferred_type are identical. If ‘equiv’, then RangeIndex can be substituted for Index with an int64 dtype as well.
Whether to check the names attribute.
Whether to compare number exactly.
Whether to compare internal Categorical exactly.
Whether to compare the order of index entries as well as their values. If True, both indexes must contain the same elements, in the same order. If False, both indexes must contain the same elements, but in any order.
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.
Examples
>>> from pandas import testing as tm
>>> a = pd.Index([1, 2, 3])
>>> b = pd.Index([1, 2, 3])
>>> tm.assert_index_equal(a, b)
© 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_index_equal.html