MCPcopy
hub / github.com/pandas-dev/pandas / assert_series_equal

Function assert_series_equal

pandas/_testing/asserters.py:860–1144  ·  view source on GitHub ↗

Check that left and right Series are equal. Parameters ---------- left : Series First Series to compare. right : Series Second Series to compare. check_dtype : bool, default True Whether to check the Series dtype is identical. check_index_type :

(
    left,
    right,
    check_dtype: bool | Literal["equiv"] = True,
    check_index_type: bool | Literal["equiv"] = "equiv",
    check_series_type: bool = True,
    check_names: bool = True,
    check_exact: bool | lib.NoDefault = lib.no_default,
    check_datetimelike_compat: bool = False,
    check_categorical: bool = True,
    check_category_order: bool = True,
    check_freq: bool = True,
    check_flags: bool = True,
    rtol: float | lib.NoDefault = lib.no_default,
    atol: float | lib.NoDefault = lib.no_default,
    obj: str = "Series",
    *,
    check_index: bool = True,
    check_like: bool = False,
)

Source from the content-addressed store, hash-verified

858@set_module("pandas.testing")
859@deprecate_kwarg(Pandas4Warning, "check_datetimelike_compat", new_arg_name=None)
860def assert_series_equal(
861 left,
862 right,
863 check_dtype: bool | Literal["equiv"] = True,
864 check_index_type: bool | Literal["equiv"] = "equiv",
865 check_series_type: bool = True,
866 check_names: bool = True,
867 check_exact: bool | lib.NoDefault = lib.no_default,
868 check_datetimelike_compat: bool = False,
869 check_categorical: bool = True,
870 check_category_order: bool = True,
871 check_freq: bool = True,
872 check_flags: bool = True,
873 rtol: float | lib.NoDefault = lib.no_default,
874 atol: float | lib.NoDefault = lib.no_default,
875 obj: str = "Series",
876 *,
877 check_index: bool = True,
878 check_like: bool = False,
879) -> None:
880 """
881 Check that left and right Series are equal.
882
883 Parameters
884 ----------
885 left : Series
886 First Series to compare.
887 right : Series
888 Second Series to compare.
889 check_dtype : bool, default True
890 Whether to check the Series dtype is identical.
891 check_index_type : bool or {'equiv'}, default 'equiv'
892 Whether to check the Index class, dtype and inferred_type
893 are identical.
894 check_series_type : bool, default True
895 Whether to check the Series class is identical.
896 check_names : bool, default True
897 Whether to check the Series and Index names attribute.
898 check_exact : bool, default False
899 Whether to compare number exactly. This also applies when checking
900 Index equivalence.
901
902 .. versionchanged:: 2.2.0
903
904 Defaults to True for integer dtypes if none of
905 ``check_exact``, ``rtol`` and ``atol`` are specified.
906
907 .. versionchanged:: 3.0.0
908
909 check_exact for comparing the Indexes defaults to True by
910 checking if an Index is of integer dtypes.
911
912 check_datetimelike_compat : bool, default False
913 Compare datetime-like which is comparable ignoring dtype.
914
915 .. deprecated:: 3.0
916
917 check_categorical : bool, default True

Callers 5

assert_almost_equalFunction · 0.85
assert_frame_equalFunction · 0.85
assert_equalFunction · 0.85

Calls 15

is_numeric_dtypeFunction · 0.90
is_float_dtypeFunction · 0.90
needs_i8_conversionFunction · 0.90
IndexClass · 0.90
_check_isinstanceFunction · 0.85
assert_class_equalFunction · 0.85
raise_assert_detailFunction · 0.85
assert_index_equalFunction · 0.85
assert_attr_equalFunction · 0.85
assert_numpy_array_equalFunction · 0.85