polars.Series.equals#

Series.equals(
other: Series,
*,
null_equal: bool = True,
strict: bool = False,
) bool[source]#

Check whether the Series is equal to another Series.

Parameters:
other

Series to compare with.

null_equal

Consider null values as equal.

strict

Don’t allow different numerical dtypes, e.g. comparing pl.UInt32 with a pl.Int64 will return False.

See also

assert_series_equal

Examples

>>> s1 = pl.Series("a", [1, 2, 3])
>>> s2 = pl.Series("b", [4, 5, 6])
>>> s1.equals(s1)
True
>>> s1.equals(s2)
False