File tree 1 file changed +27
-0
lines changed
1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change
1
+ import numpy as np
1
2
import pytest
2
3
3
4
from pandas .core .dtypes .common import is_extension_array_dtype
@@ -382,3 +383,29 @@ def test_assert_series_equal_identical_na(nulls_fixture):
382
383
# while we're here do Index too
383
384
idx = pd .Index (ser )
384
385
tm .assert_index_equal (idx , idx .copy (deep = True ))
386
+
387
+
388
+ def test_identical_nested_series_is_equal ():
389
+ # GH#22400
390
+ x = Series (
391
+ [
392
+ 0 ,
393
+ 0.0131142231938 ,
394
+ 1.77774652865e-05 ,
395
+ np .array ([0.4722720840328748 , 0.4216929783681722 ]),
396
+ ]
397
+ )
398
+ y = Series (
399
+ [
400
+ 0 ,
401
+ 0.0131142231938 ,
402
+ 1.77774652865e-05 ,
403
+ np .array ([0.4722720840328748 , 0.4216929783681722 ]),
404
+ ]
405
+ )
406
+ # These two arrays should be equal, nesting could cause issue
407
+
408
+ tm .assert_series_equal (x , x )
409
+ tm .assert_series_equal (x , x , check_exact = True )
410
+ tm .assert_series_equal (x , y )
411
+ tm .assert_series_equal (x , y , check_exact = True )
You can’t perform that action at this time.
0 commit comments