@@ -495,7 +495,7 @@ def test_concat_categorical(self):
495495 s1 = pd .Series ([10 , 11 , np .nan ], dtype = 'category' )
496496 s2 = pd .Series ([np .nan , 1 , 3 , 2 ], dtype = 'category' )
497497
498- exp = pd .Series ([10 , 11 , np .nan , np .nan , 1 , 3 , 2 ])
498+ exp = pd .Series ([10 , 11 , np .nan , np .nan , 1 , 3 , 2 ], dtype = 'object' )
499499 tm .assert_series_equal (pd .concat ([s1 , s2 ], ignore_index = True ), exp )
500500 tm .assert_series_equal (s1 .append (s2 , ignore_index = True ), exp )
501501
@@ -515,12 +515,12 @@ def test_concat_categorical_coercion(self):
515515 s1 = pd .Series ([1 , 2 , np .nan ], dtype = 'category' )
516516 s2 = pd .Series ([2 , 1 , 2 ])
517517
518- exp = pd .Series ([1 , 2 , np .nan , 2 , 1 , 2 ])
518+ exp = pd .Series ([1 , 2 , np .nan , 2 , 1 , 2 ], dtype = 'object' )
519519 tm .assert_series_equal (pd .concat ([s1 , s2 ], ignore_index = True ), exp )
520520 tm .assert_series_equal (s1 .append (s2 , ignore_index = True ), exp )
521521
522522 # result shouldn't be affected by 1st elem dtype
523- exp = pd .Series ([2 , 1 , 2 , 1 , 2 , np .nan ])
523+ exp = pd .Series ([2 , 1 , 2 , 1 , 2 , np .nan ], dtype = 'object' )
524524 tm .assert_series_equal (pd .concat ([s2 , s1 ], ignore_index = True ), exp )
525525 tm .assert_series_equal (s2 .append (s1 , ignore_index = True ), exp )
526526
@@ -540,11 +540,11 @@ def test_concat_categorical_coercion(self):
540540 s1 = pd .Series ([10 , 11 , np .nan ], dtype = 'category' )
541541 s2 = pd .Series ([1 , 3 , 2 ])
542542
543- exp = pd .Series ([10 , 11 , np .nan , 1 , 3 , 2 ])
543+ exp = pd .Series ([10 , 11 , np .nan , 1 , 3 , 2 ], dtype = 'object' )
544544 tm .assert_series_equal (pd .concat ([s1 , s2 ], ignore_index = True ), exp )
545545 tm .assert_series_equal (s1 .append (s2 , ignore_index = True ), exp )
546546
547- exp = pd .Series ([1 , 3 , 2 , 10 , 11 , np .nan ])
547+ exp = pd .Series ([1 , 3 , 2 , 10 , 11 , np .nan ], dtype = 'object' )
548548 tm .assert_series_equal (pd .concat ([s2 , s1 ], ignore_index = True ), exp )
549549 tm .assert_series_equal (s2 .append (s1 , ignore_index = True ), exp )
550550
@@ -580,11 +580,13 @@ def test_concat_categorical_3elem_coercion(self):
580580 s2 = pd .Series ([2 , 1 , 2 ], dtype = 'category' )
581581 s3 = pd .Series ([1 , 2 , 1 , 2 , np .nan ])
582582
583- exp = pd .Series ([1 , 2 , np .nan , 2 , 1 , 2 , 1 , 2 , 1 , 2 , np .nan ])
583+ exp = pd .Series ([1 , 2 , np .nan , 2 , 1 , 2 , 1 , 2 , 1 , 2 , np .nan ],
584+ dtype = 'object' )
584585 tm .assert_series_equal (pd .concat ([s1 , s2 , s3 ], ignore_index = True ), exp )
585586 tm .assert_series_equal (s1 .append ([s2 , s3 ], ignore_index = True ), exp )
586587
587- exp = pd .Series ([1 , 2 , 1 , 2 , np .nan , 1 , 2 , np .nan , 2 , 1 , 2 ])
588+ exp = pd .Series ([1 , 2 , 1 , 2 , np .nan , 1 , 2 , np .nan , 2 , 1 , 2 ],
589+ dtype = 'object' )
588590 tm .assert_series_equal (pd .concat ([s3 , s1 , s2 ], ignore_index = True ), exp )
589591 tm .assert_series_equal (s3 .append ([s1 , s2 ], ignore_index = True ), exp )
590592
@@ -668,7 +670,7 @@ def test_concat_categorical_coercion_nan(self):
668670 s1 = pd .Series ([1 , np .nan ], dtype = 'category' )
669671 s2 = pd .Series ([np .nan , np .nan ])
670672
671- exp = pd .Series ([1 , np .nan , np .nan , np .nan ])
673+ exp = pd .Series ([1 , np .nan , np .nan , np .nan ], dtype = 'object' )
672674 tm .assert_series_equal (pd .concat ([s1 , s2 ], ignore_index = True ), exp )
673675 tm .assert_series_equal (s1 .append (s2 , ignore_index = True ), exp )
674676
0 commit comments