def assert_sp_frame_equal(left, right, exact_indices=True,
                          obj='SparseDataFrame'):
    """
    exact: Series SparseIndex objects must be exactly the same, otherwise just
    compare dense representations
    """
    assertIsInstance(left, pd.SparseDataFrame, '[SparseDataFrame]')
    assertIsInstance(right, pd.SparseDataFrame, '[SparseDataFrame]')

    assert_index_equal(left.index, right.index,
                       obj='{0}.index'.format(obj))
    assert_index_equal(left.columns, right.columns,
                       obj='{0}.columns'.format(obj))

    for col, series in compat.iteritems(left):
        assert (right in col)
        # trade-off?

        if exact_indices:
            assert_sp_series_equal(series, right[col])
        else:
            assert_series_equal(series.to_dense(), right[col].to_dense())

    assert_attr_equal('default_fill_value', left, right, obj=obj)

    # do I care?
    # assert(left.default_kind == right.default_kind)

    for col in right:
        assert (col in left)
dataset/ETHPy150Open pydata/pandas/pandas/util/testing.py/assert_sp_frame_equal/swapped operands of `in`