File tree 1 file changed +1
-11
lines changed
1 file changed +1
-11
lines changed Original file line number Diff line number Diff line change @@ -358,7 +358,7 @@ def agg_list_like(self) -> DataFrame | Series:
358
358
keys = selected_obj .columns .take (indices )
359
359
360
360
try :
361
- concatenated = concat (results , keys = keys , axis = 1 , sort = False )
361
+ return concat (results , keys = keys , axis = 1 , sort = False )
362
362
except TypeError as err :
363
363
# we are concatting non-NDFrame objects,
364
364
# e.g. a list of scalars
@@ -370,16 +370,6 @@ def agg_list_like(self) -> DataFrame | Series:
370
370
"cannot combine transform and aggregation operations"
371
371
) from err
372
372
return result
373
- else :
374
- # Concat uses the first index to determine the final indexing order.
375
- # The union of a shorter first index with the other indices causes
376
- # the index sorting to be different from the order of the aggregating
377
- # functions. Reindex if this is the case.
378
- index_size = concatenated .index .size
379
- full_ordered_index = next (
380
- result .index for result in results if result .index .size == index_size
381
- )
382
- return concatenated .reindex (full_ordered_index , copy = False )
383
373
384
374
def agg_dict_like (self ) -> DataFrame | Series :
385
375
"""
You can’t perform that action at this time.
0 commit comments