Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions pandas/tests/series/test_constructors.py
Original file line number Diff line number Diff line change
Expand Up @@ -2128,3 +2128,22 @@ def test_constructor(rand_series_with_duplicate_datetimeindex):
def test_numpy_array(input_dict, expected):
result = np.array([Series(input_dict)])
tm.assert_numpy_array_equal(result, expected)


def test_index_ordered_dict_keys():
# GH 22077

param_index = OrderedDict(
[
((("a", "b"), ("c", "d")), 1),
((("a", None), ("c", "d")), 2),
]
)
series = Series([1, 2], index=param_index.keys())
expected = Series(
[1, 2],
index=MultiIndex.from_tuples(
[(("a", "b"), ("c", "d")), (("a", None), ("c", "d"))]
),
)
tm.assert_series_equal(series, expected)