@@ -2421,13 +2421,15 @@ def concat_same_type(self, to_concat, placement=None):
2421
2421
Concatenate list of single blocks of the same type.
2422
2422
"""
2423
2423
to_concat = [blk .values for blk in to_concat ]
2424
- values = _concat ._concat_categorical (to_concat )
2424
+ values = _concat ._concat_categorical (to_concat , axis = self . ndim - 1 )
2425
2425
2426
2426
if is_categorical_dtype (values .dtype ):
2427
2427
return self .make_block_same_class (
2428
2428
values , placement = placement or slice (0 , len (values ), 1 ))
2429
2429
else :
2430
- return make_block (values , placement = placement or slice (0 , len (values ), 1 ))
2430
+ return make_block (
2431
+ values , placement = placement or slice (0 , len (values ), 1 ),
2432
+ ndim = self .ndim )
2431
2433
2432
2434
2433
2435
class DatetimeBlock (DatetimeLikeBlockMixin , Block ):
@@ -2711,13 +2713,14 @@ def concat_same_type(self, to_concat, placement=None):
2711
2713
Concatenate list of single blocks of the same type.
2712
2714
"""
2713
2715
to_concat = [blk .values for blk in to_concat ]
2714
- values = _concat ._concat_datetime (to_concat )
2716
+ values = _concat ._concat_datetime (to_concat , axis = self . ndim - 1 )
2715
2717
2716
2718
if is_datetimetz (values ):
2717
2719
return self .make_block_same_class (
2718
2720
values , placement = placement or slice (0 , len (values ), 1 ))
2719
2721
else :
2720
- return make_block (values , placement = placement or slice (0 , len (values ), 1 ))
2722
+ return make_block (
2723
+ values , placement = placement or slice (0 , len (values ), 1 ))
2721
2724
2722
2725
2723
2726
class SparseBlock (NonConsolidatableMixIn , Block ):
0 commit comments