diff --git a/pandas/tests/util/test_assert_series_equal.py b/pandas/tests/util/test_assert_series_equal.py index 2209bed67325c..963af81bcb6a5 100644 --- a/pandas/tests/util/test_assert_series_equal.py +++ b/pandas/tests/util/test_assert_series_equal.py @@ -1,3 +1,4 @@ +import numpy as np import pytest from pandas.core.dtypes.common import is_extension_array_dtype @@ -382,3 +383,29 @@ def test_assert_series_equal_identical_na(nulls_fixture): # while we're here do Index too idx = pd.Index(ser) tm.assert_index_equal(idx, idx.copy(deep=True)) + + +def test_identical_nested_series_is_equal(): + # GH#22400 + x = Series( + [ + 0, + 0.0131142231938, + 1.77774652865e-05, + np.array([0.4722720840328748, 0.4216929783681722]), + ] + ) + y = Series( + [ + 0, + 0.0131142231938, + 1.77774652865e-05, + np.array([0.4722720840328748, 0.4216929783681722]), + ] + ) + # These two arrays should be equal, nesting could cause issue + + tm.assert_series_equal(x, x) + tm.assert_series_equal(x, x, check_exact=True) + tm.assert_series_equal(x, y) + tm.assert_series_equal(x, y, check_exact=True)