Skip to content

Commit 5cd8392

Browse files
author
Ben Kandel
committed
added test for names
1 parent bc5f1fb commit 5cd8392

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

pandas/tests/frame/test_combine_concat.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -332,8 +332,11 @@ def test_concat_named_keys(self):
332332
df = DataFrame({'foo': [1, 2, 3, 4],
333333
'bar': [0.1, 0.2, 0.3, 0.4]})
334334
index = Index(['a', 'b'], name='baz')
335-
concatted = pd.concat([df, df], keys=index)
336-
assert_equal(concatted.index.names, FrozenList(['baz', None]))
335+
concatted_named_from_keys = pd.concat([df, df], keys=index)
336+
assert_equal(concatted_named_from_keys.index.names, FrozenList(['baz', None]))
337+
index_no_name = ['a', 'b']
338+
concatted_named_from_names = pd.concat([df, df], keys=index_no_name, names=['baz'])
339+
assert_equal(concatted_named_from_names.index.names, FrozenList(['baz', None]))
337340

338341

339342
class TestDataFrameCombineFirst(tm.TestCase, TestData):

0 commit comments

Comments
 (0)