deep_equals

deep_equals(x, y, ignore_index=False, return_msg=False)[source]

Test two objects for equality in value.

Intended for:

pd.Series, pd.DataFrame, np.ndarray, lists, tuples, or dicts. Will recursively compare nested objects.

Important note:

this function will return “not equal” if types of x,y are different for instant, bool and numpy.bool are not considered equal

Parameters:
xobject

First item to compare.

yobject

Second item to compare.

ignore_indexbool, default=False

If True, will ignore the index of pd.Series and pd.DataFrame.

return_msgbool, default=False

Whether to return an informative message about what is not equal.

Returns:
is_equal: bool

True if x and y are equal in value, x and y do not need to be equal in reference.

msgstr

Only returned if return_msg is True. Indication of what is the reason for not being equal