Skip to content

Commit 2b9ac4a

Browse files
committed
revert to test with dictionary
1 parent 02b3a4d commit 2b9ac4a

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

pandas/tests/frame/test_alter_axes.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,11 @@ def test_dti_set_index_reindex(self):
392392

393393
assert new_index.freq == index.freq
394394

395+
def test_set_index_tuple(self):
396+
# test for fix of issue #15457, where the following raised a TypeError
397+
df = DataFrame([[2, 1, 2], [4, (1, 2), 3]]).set_index([0, 1])
398+
assert df.to_dict() == {2: {(2, 1): 2, (4, (1, 2)): 3}}
399+
395400
# Renaming
396401

397402
def test_rename(self):

pandas/tests/indexes/multi/test_constructor.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -313,13 +313,6 @@ def test_from_product_empty_zero_levels():
313313
MultiIndex.from_product([])
314314

315315

316-
def test_set_index_tuple():
317-
# test for fix of issue #15457, where the following raised a TypeError
318-
result = pd.MultiIndex.from_arrays([[2, 4], [1, (1, 2)]])
319-
expected = pd.MultiIndex.from_tuples([(2, 4), (1, (1, 2))])
320-
assert result == expected
321-
322-
323316
def test_from_product_empty_one_level():
324317
result = MultiIndex.from_product([[]], names=['A'])
325318
expected = pd.Index([], name='A')
@@ -470,3 +463,4 @@ def test_tuples_with_name_string():
470463
pd.Index(li, name='abc')
471464
with pytest.raises(ValueError):
472465
pd.Index(li, name='a')
466+

0 commit comments

Comments
 (0)