Skip to content

Commit

Permalink
One more round of review
Browse files Browse the repository at this point in the history
  • Loading branch information
h-vetinari committed May 3, 2018
1 parent 08593e0 commit d270178
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pandas/core/strings.py
Original file line number Diff line number Diff line change
Expand Up @@ -1966,8 +1966,13 @@ def _get_series_list(self, others, ignore_index=False):
'list-like (either containing only strings or containing '
'only objects of type Series/Index/list-like/np.ndarray)')

# Generally speaking, all objects without an index inherit the index
# `idx` of the calling Series/Index - i.e. must have matching length.
# Objects with an index (i.d. Series/Index/DataFrame) keep their own
# index, *unless* ignore_index is set to True.
if isinstance(others, Series):
warn = not others.index.equals(idx)
# only reconstruct Series when absolutely necessary
los = [Series(others.values, index=idx)
if ignore_index and warn else others]
return (los, warn)
Expand Down

0 comments on commit d270178

Please sign in to comment.