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 3bf38a0
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.e. 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 3bf38a0

Please sign in to comment.