ENH: check_like for assert_series_equal · Issue #47247 · pandas-dev/pandas (original) (raw)
Is your feature request related to a problem?
I wish assert_series_equal
would contain the same check_like
functionality as assert_frame_equal
.
Describe the solution you'd like
The solution should be the same as assert_frame_equal
.
API breaking implications
The change would be fully backward compatible (default value False
).
Describe alternatives you've considered
I currently use assert_index_equal
with check_order=False
and use assert_series_equal
with the reindexed Series.
Additional context
the following should not raise an AssertionError:
assert_series_equal( pd.Series([1, 2, 3], index=["a", "b", "c"]), pd.Series([3, 2, 1], index=["c", "b", "a"]), check_like=True, )
Note: If check_index is False then check_like must be False.
I'll create a PR in a bit.