Skip to content

Commit 01355d5

Browse files
committed
BUG: Fix 'left' join turned into 'outer' join when joining with a sequence of dataframes (pandas-dev#19607)
1 parent 7dcc864 commit 01355d5

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

pandas/core/frame.py

+6-7
Original file line numberDiff line numberDiff line change
@@ -5328,18 +5328,17 @@ def _join_compat(self, other, on=None, how='left', lsuffix='', rsuffix='',
53285328
raise ValueError('Joining multiple DataFrames only supported'
53295329
' for joining on index')
53305330

5331-
# join indexes only using concat
5332-
if how == 'left':
5333-
how = 'outer'
5334-
join_axes = [self.index]
5335-
else:
5336-
join_axes = None
5337-
53385331
frames = [self] + list(other)
53395332

53405333
can_concat = all(df.index.is_unique for df in frames)
53415334

5335+
# join indexes only using concat
53425336
if can_concat:
5337+
if how == 'left':
5338+
how = 'outer'
5339+
join_axes = [self.index]
5340+
else:
5341+
join_axes = None
53435342
return concat(frames, axis=1, join=how, join_axes=join_axes,
53445343
verify_integrity=True)
53455344

0 commit comments

Comments
 (0)