@@ -1447,6 +1447,12 @@ def test_constructor_dict_of_tuples(self):
1447
1447
expected = Series ([3 , 6 ], index = MultiIndex .from_tuples ([(1 , 2 ), (None , 5 )]))
1448
1448
tm .assert_series_equal (result , expected )
1449
1449
1450
+ # GH 60695
1451
+ data = {(1 ,): 3 , (4 , 5 ): 6 }
1452
+ result = Series (data ).sort_values ()
1453
+ expected = Series ([3 , 6 ], index = MultiIndex .from_tuples ([(1 , None ), (4 , 5 )]))
1454
+ tm .assert_series_equal (result , expected )
1455
+
1450
1456
# https://github.com/pandas-dev/pandas/issues/22698
1451
1457
@pytest .mark .filterwarnings ("ignore:elementwise comparison:FutureWarning" )
1452
1458
def test_fromDict (self , using_infer_string ):
@@ -1878,6 +1884,15 @@ def test_constructor_dict_multiindex(self):
1878
1884
result = result .reindex (index = expected .index )
1879
1885
tm .assert_series_equal (result , expected )
1880
1886
1887
+ # GH 60695
1888
+ d = {("a" ,): 0.0 , ("a" , "b" ): 1.0 }
1889
+ _d = sorted (d .items ())
1890
+ result = Series (d )
1891
+ expected = Series (
1892
+ [x [1 ] for x in _d ], index = MultiIndex .from_tuples ([x [0 ] for x in _d ])
1893
+ )
1894
+ tm .assert_series_equal (result , expected )
1895
+
1881
1896
def test_constructor_dict_multiindex_reindex_flat (self ):
1882
1897
# construction involves reindexing with a MultiIndex corner case
1883
1898
data = {("i" , "i" ): 0 , ("i" , "j" ): 1 , ("j" , "i" ): 2 , "j" : np .nan }
0 commit comments