Skip to content

Commit

Permalink
BUG: Fix 'left' join turned into 'outer' join when joining with a seq…
Browse files Browse the repository at this point in the history
…uence of dataframes (pandas-dev#19607)
  • Loading branch information
elrubio committed Feb 9, 2018
1 parent 7dcc864 commit 01355d5
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions pandas/core/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -5328,18 +5328,17 @@ def _join_compat(self, other, on=None, how='left', lsuffix='', rsuffix='',
raise ValueError('Joining multiple DataFrames only supported'
' for joining on index')

# join indexes only using concat
if how == 'left':
how = 'outer'
join_axes = [self.index]
else:
join_axes = None

frames = [self] + list(other)

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

# join indexes only using concat
if can_concat:
if how == 'left':
how = 'outer'
join_axes = [self.index]
else:
join_axes = None
return concat(frames, axis=1, join=how, join_axes=join_axes,
verify_integrity=True)

Expand Down

0 comments on commit 01355d5

Please sign in to comment.