def assert_frame_equal(left, right, check_dtype=True,<EOL>check_index_type='<STR_LIT>',<EOL>check_column_type='<STR_LIT>',<EOL>check_frame_type=True,<EOL>check_less_precise=False,<EOL>check_names=True,<EOL>by_blocks=False,<EOL>check_exact=False,<EOL>check_datetimelike_compat=False,<EOL>check_categorical=True,<EOL>check_like=False,<EOL>obj='<STR_LIT>'):
__tracebackhide__ = True<EOL>_check_isinstance(left, right, DataFrame)<EOL>if check_frame_type:<EOL><INDENT>assert isinstance(left, type(right))<EOL><DEDENT>if left.shape != right.shape:<EOL><INDENT>raise_assert_detail(obj,<EOL>'<STR_LIT>',<EOL>'<STR_LIT>'.format(shape=left.shape),<EOL>'<STR_LIT>'.format(shape=right.shape))<EOL><DEDENT>if check_like:<EOL><INDENT>left, right = left.reindex_like(right), right<EOL><DEDENT>assert_index_equal(left.index, right.index, exact=check_index_type,<EOL>check_names=check_names,<EOL>check_less_precise=check_less_precise,<EOL>check_exact=check_exact,<EOL>check_categorical=check_categorical,<EOL>obj='<STR_LIT>'.format(obj=obj))<EOL>assert_index_equal(left.columns, right.columns, exact=check_column_type,<EOL>check_names=check_names,<EOL>check_less_precise=check_less_precise,<EOL>check_exact=check_exact,<EOL>check_categorical=check_categorical,<EOL>obj='<STR_LIT>'.format(obj=obj))<EOL>if by_blocks:<EOL><INDENT>rblocks = right._to_dict_of_blocks()<EOL>lblocks = left._to_dict_of_blocks()<EOL>for dtype in list(set(list(lblocks.keys()) + list(rblocks.keys()))):<EOL><INDENT>assert dtype in lblocks<EOL>assert dtype in rblocks<EOL>assert_frame_equal(lblocks[dtype], rblocks[dtype],<EOL>check_dtype=check_dtype, obj='<STR_LIT>')<EOL><DEDENT><DEDENT>else:<EOL><INDENT>for i, col in enumerate(left.columns):<EOL><INDENT>assert col in right<EOL>lcol = left.iloc[:, i]<EOL>rcol = right.iloc[:, i]<EOL>assert_series_equal(<EOL>lcol, rcol, check_dtype=check_dtype,<EOL>check_index_type=check_index_type,<EOL>check_less_precise=check_less_precise,<EOL>check_exact=check_exact, check_names=check_names,<EOL>check_datetimelike_compat=check_datetimelike_compat,<EOL>check_categorical=check_categorical,<EOL>obj='<STR_LIT>'.format(idx=i))<EOL><DEDENT><DEDENT>
Check that left and right DataFrame are equal.

This function is intended to compare two DataFrames and output any
differences. Is is mostly intended for use in unit tests.
Additional parameters allow varying the strictness of the
equality checks performed.

Parameters
----------
left : DataFrame
    First DataFrame to compare.
right : DataFrame
    Second DataFrame to compare.
check_dtype : bool, default True
    Whether to check the DataFrame dtype is identical.
check_index_type : bool / string {'equiv'}, default 'equiv'
    Whether to check the Index class, dtype and inferred_type
    are identical.
check_column_type : bool / string {'equiv'}, default 'equiv'
    Whether to check the columns class, dtype and inferred_type
    are identical. Is passed as the ``exact`` argument of
    :func:`assert_index_equal`.
check_frame_type : bool, default True
    Whether to check the DataFrame class is identical.
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.

    When comparing two numbers, if the first number has magnitude less
    than 1e-5, we compare the two numbers directly and check whether
    they are equivalent within the specified precision. Otherwise, we
    compare the **ratio** of the second number to the first number and
    check whether it is equivalent to 1 within the specified precision.
check_names : bool, default True
    Whether to check that the `names` attribute for both the `index`
    and `column` attributes of the DataFrame is identical, i.e.

    * left.index.names == right.index.names
    * left.columns.names == right.columns.names
by_blocks : bool, default False
    Specify how to compare internal data. If False, compare by columns.
    If True, compare by blocks.
check_exact : bool, default False
    Whether to compare number exactly.
check_datetimelike_compat : bool, default False
    Compare datetime-like which is comparable ignoring dtype.
check_categorical : bool, default True
    Whether to compare internal Categorical exactly.
check_like : bool, default False
    If True, ignore the order of index & columns.
    Note: index labels must match their respective rows
    (same as in columns) - same labels must be with the same data.
obj : str, default 'DataFrame'
    Specify object name being compared, internally used to show appropriate
    assertion message.

See Also
--------
assert_series_equal : Equivalent method for asserting Series equality.
DataFrame.equals : Check DataFrame equality.

Examples
--------
This example shows comparing two DataFrames that are equal
but with columns of differing dtypes.

>>> from pandas.util.testing import assert_frame_equal
>>> df1 = pd.DataFrame({'a': [1, 2], 'b': [3, 4]})
>>> df2 = pd.DataFrame({'a': [1, 2], 'b': [3.0, 4.0]})

df1 equals itself.

>>> assert_frame_equal(df1, df1)

df1 differs from df2 as column 'b' is of a different type.

>>> assert_frame_equal(df1, df2)
Traceback (most recent call last):
AssertionError: Attributes are different
...
Attribute "dtype" are different
[left]:  int64
[right]: float64

Ignore differing dtypes in columns with check_dtype.

>>> assert_frame_equal(df1, df2, check_dtype=False)