# pandas.testing.assert_index_equal

`pandas.testing.``assert_index_equal`(left: pandas.core.indexes.base.Index, right: pandas.core.indexes.base.Index, exact: Union[bool, str] = 'equiv', check_names: bool = True, check_less_precise: Union[bool, int] = False, check_exact: bool = True, check_categorical: bool = True, obj: str = 'Index') → None

  Check that left and right Index are equal.

  Parameters:

  left : Index

  right : Index

  exact : bool / string {‘equiv’}, default ‘equiv’

  > Whether to check the Index class, dtype and inferred_type are identical. If ‘equiv’, then RangeIndex can be substituted for Int64Index as well.

  check_names : bool, default True

  > Whether to check the names attribute.

  check_less_precise : bool or int, default False

  > Specify comparison precision. Only used when check_exact is False. 5 digits (False) or 3 digits (True) after decimal points are compared. If int, then specify the digits to compare

  check_exact : bool, default True

  > Whether to compare number exactly.

  check_categorical : bool, default True

  > Whether to compare internal Categorical exactly.

  obj : str, default ‘Index’

  > Specify object name being compared, internally used to show appropriate assertion message

Scroll To Top