Skip to content

Commit c0d3ec4

Browse files
committed
Incorporate review (jreback) [ci skip]
1 parent 3d2bb1c commit c0d3ec4

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

pandas/tests/indexes/common.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -366,10 +366,12 @@ def test_duplicated(self, indices, keep):
366366

367367
idx = self._holder(indices)
368368
if idx.has_duplicates:
369-
# We need to be able to control creation of duplicates here
370-
# This is slightly circular, as drop_duplicates depends on
371-
# duplicated, but in the end, it all works out because we
372-
# cross-check with Series.duplicated
369+
# We are testing the duplicated-method here, so we need to know
370+
# exactly which indices are duplicate and how (for the result).
371+
# This is not possible if "idx" has duplicates already, which we
372+
# therefore remove. This is seemingly circular, as drop_duplicates
373+
# invokes duplicated, but in the end, it all works out because we
374+
# cross-check with Series.duplicated, which is tested separately.
373375
idx = idx.drop_duplicates()
374376

375377
n, k = len(idx), 10

0 commit comments

Comments
 (0)