polars.DataFrame.frame_equal#

DataFrame.frame_equal(
other: DataFrame,
*,
null_equal: bool = True,
) bool[source]#

Check if DataFrame is equal to other.

Parameters:
other

DataFrame to compare with.

null_equal

Consider null values as equal.

Examples

>>> df1 = pl.DataFrame(
...     {
...         "foo": [1, 2, 3],
...         "bar": [6.0, 7.0, 8.0],
...         "ham": ["a", "b", "c"],
...     }
... )
>>> df2 = pl.DataFrame(
...     {
...         "foo": [3, 2, 1],
...         "bar": [8.0, 7.0, 6.0],
...         "ham": ["c", "b", "a"],
...     }
... )
>>> df1.frame_equal(df1)
True
>>> df1.frame_equal(df2)
False