Skip to content

Commit 764cf55

Browse files
committed
TST: extend test and add issue reference
1 parent 62cfbad commit 764cf55

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

pandas/tests/frame/test_api.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,13 @@ def test_iteritems(self):
174174
assert type(v) == self.klass._constructor_sliced
175175

176176
def test_items(self):
177-
df = DataFrame([[1, 2, 3], [4, 5, 6]], columns=['a', 'a', 'b'])
178-
for k, v in df.items():
177+
# issue #17213, #13918
178+
cols = ['a', 'b', 'c']
179+
df = DataFrame([[1, 2, 3], [4, 5, 6]], columns=cols)
180+
for c, (k, v) in zip(cols, df.items()):
181+
assert c == k
179182
assert type(v) == Series
183+
assert (df[k] == v).all()
180184

181185
def test_iter(self):
182186
assert tm.equalContents(list(self.frame), self.frame.columns)

0 commit comments

Comments
 (0)