Skip to content

Commit 87bb1ac

Browse files
Fixes pandas-dev#21510 Remove sort if its already an ordered dict
1 parent 9e982e1 commit 87bb1ac

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

pandas/core/reshape/concat.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
22
concat routines
33
"""
4-
4+
from collections import OrderedDict
55
import numpy as np
66
from pandas import compat, DataFrame, Series, Index, MultiIndex
77
from pandas.core.index import (_get_objs_combined_axis,
@@ -250,7 +250,10 @@ def __init__(self, objs, axis=0, join='outer', join_axes=None,
250250

251251
if isinstance(objs, dict):
252252
if keys is None:
253-
keys = sorted(objs)
253+
if not isinstance(objs,OrderedDict):
254+
keys = sorted(objs)
255+
else:
256+
keys = objs
254257
objs = [objs[k] for k in keys]
255258
else:
256259
objs = list(objs)

0 commit comments

Comments
 (0)