pandas.testing.
assert_series_equal
Check that left and right Series are equal.
Whether to check the Series dtype is identical.
Whether to check the Index class, dtype and inferred_type are identical.
Whether to check the Series class is identical.
Specify comparison precision. Only used when check_exact is False. 5 digits (False) or 3 digits (True) after decimal points are compared. If int, then specify the digits to compare.
When comparing two numbers, if the first number has magnitude less than 1e-5, we compare the two numbers directly and check whether they are equivalent within the specified precision. Otherwise, we compare the ratio of the second number to the first number and check whether it is equivalent to 1 within the specified precision.
Deprecated since version 1.1.0: Use rtol and atol instead to define relative/absolute tolerance, respectively. Similar to math.isclose().
math.isclose()
Whether to check the Series and Index names attribute.
Whether to compare number exactly.
Compare datetime-like which is comparable ignoring dtype.
Whether to compare internal Categorical exactly.
Whether to compare category order of internal Categoricals.
New in version 1.0.2.
Whether to check the freq attribute on a DatetimeIndex or TimedeltaIndex.
Whether to check the flags attribute.
New in version 1.2.0.
Relative tolerance. Only used when check_exact is False.
New in version 1.1.0.
Absolute tolerance. Only used when check_exact is False.
Specify object name being compared, internally used to show appropriate assertion message.
Examples
>>> from pandas.testing import assert_series_equal >>> a = pd.Series([1, 2, 3, 4]) >>> b = pd.Series([1, 2, 3, 4]) >>> assert_series_equal(a, b)