File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -8672,6 +8672,9 @@ def combine(
8672
8672
"""
8673
8673
other_idxlen = len (other .index ) # save for compare
8674
8674
8675
+ # preserve column order
8676
+ new_columns = self .columns .union (other .columns , sort = False )
8677
+
8675
8678
this , other = self .align (other )
8676
8679
new_index = this .index
8677
8680
@@ -8681,8 +8684,6 @@ def combine(
8681
8684
if self .empty and len (other ) == other_idxlen :
8682
8685
return other .copy ()
8683
8686
8684
- # sorts if possible; otherwise align above ensures that these are set-equal
8685
- new_columns = this .columns .union (other .columns )
8686
8687
do_fill = fill_value is not None
8687
8688
result = {}
8688
8689
for col in new_columns :
@@ -8806,10 +8807,7 @@ def combiner(x: Series, y: Series):
8806
8807
)
8807
8808
combined = combined .astype (other .dtypes )
8808
8809
else :
8809
- # preserve column order
8810
- new_columns = self .columns .union (other .columns , sort = False )
8811
8810
combined = self .combine (other , combiner , overwrite = False )
8812
- combined = combined .reindex (columns = new_columns )
8813
8811
8814
8812
dtypes = {
8815
8813
col : find_common_type ([self .dtypes [col ], other .dtypes [col ]])
You can’t perform that action at this time.
0 commit comments