Skip to content

Commit

Permalink
Fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
h-vetinari committed Aug 14, 2018
1 parent 6047a8c commit dbb489d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
8 changes: 4 additions & 4 deletions pandas/core/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -6614,11 +6614,11 @@ def _join_compat(self, other, on=None, how='left', lsuffix='', rsuffix='',
if can_concat:
if how == 'left':
how = 'outer'
join_axes = [self.index]
return concat(frames, axis=1, join=how,
verify_integrity=True).reindex(self.index)
else:
join_axes = None
return concat(frames, axis=1, join=how, join_axes=join_axes,
verify_integrity=True)
return concat(frames, axis=1, join=how,
verify_integrity=True)

joined = frames[0]

Expand Down
2 changes: 1 addition & 1 deletion pandas/core/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -8848,7 +8848,7 @@ def describe_1d(data):
if name not in names:
names.append(name)

d = pd.concat(ldesc, join_axes=pd.Index([names]), axis=1)
d = pd.concat([x.reindex(names) for x in ldesc], axis=1, sort=False)
d.columns = data.columns.copy()
return d

Expand Down
6 changes: 4 additions & 2 deletions pandas/core/groupby/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -518,8 +518,10 @@ def _transform_general(self, func, *args, **kwargs):
applied.append(res)

concat_index = obj.columns if self.axis == 0 else obj.index
concatenated = concat(applied, join_axes=[concat_index],
axis=self.axis, verify_integrity=False)
other_axis = (self.axis + 1) % 2 # switches from 0 to 1 or from 1 to 0
concatenated = concat(applied, axis=self.axis,
verify_integrity=False).reindex(concat_index,
axis=other_axis)
return self._set_result_index_ordered(concatenated)

@Substitution(klass='DataFrame', selected='')
Expand Down

0 comments on commit dbb489d

Please sign in to comment.