Skip to content

Commit f53613f

Browse files
committed
mergiami
1 parent 3afd05c commit f53613f

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

pandas/core/series.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -206,15 +206,16 @@ def __init__(self, data=None, index=None, dtype=None, name=None,
206206
values = np.array([np.nan] * len(index))
207207
s = Series(values, index=keys, dtype=dtype)
208208
if index is not None:
209-
if not index.equals(s.index):
209+
if not index.identical(s.index):
210210
s = s.reindex(index)
211-
elif not isinstance(data, OrderedDict):
212-
try:
213-
s = s.sort_index()
214-
except TypeError:
215-
pass
211+
else:
212+
if not isinstance(data, OrderedDict):
213+
try:
214+
s = s.sort_index()
215+
except TypeError:
216+
pass
217+
index = s.index
216218
data = s._data
217-
index = s.index
218219
copy = False
219220
dtype = None
220221
elif isinstance(data, SingleBlockManager):

0 commit comments

Comments
 (0)