Skip to content

Commit 232f581

Browse files
Add tests for array_equivalent with Series
1 parent 75e0598 commit 232f581

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

pandas/tests/dtypes/test_missing.py

+8
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,14 @@ def test_array_equivalent(dtype_equal):
383383
assert not array_equivalent(DatetimeIndex([0, np.nan]), TimedeltaIndex([0, np.nan]))
384384

385385

386+
@pytest.mark.parametrize(
387+
"val", [1, 1.1, 1 + 1j, True, "abc", [1, 2], (1, 2), {1, 2}, {"a": 1}, None]
388+
)
389+
def test_array_equivalent_series(val):
390+
arr = np.array([1, 2])
391+
assert not array_equivalent(Series([arr, arr]), Series([arr, val]))
392+
393+
386394
def test_array_equivalent_different_dtype_but_equal():
387395
# Unclear if this is exposed anywhere in the public-facing API
388396
assert array_equivalent(np.array([1, 2]), np.array([1.0, 2.0]))

0 commit comments

Comments
 (0)