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,
)
| 858 | @set_module("pandas.testing") |
| 859 | @deprecate_kwarg(Pandas4Warning, "check_datetimelike_compat", new_arg_name=None) |
| 860 | def 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 |