Skip to content

Commit 455a60b

Browse files
committed
DOC: Update TODO comment for a single level selection from MultiIndex
1 parent e4cdd07 commit 455a60b

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

pandas/core/groupby.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -2589,8 +2589,14 @@ def _get_grouper(obj, key=None, axis=0, level=None, sort=True,
25892589
# validate that the passed single level is compatible with the passed
25902590
# axis of the object
25912591
if level is not None:
2592-
# TODO: These two conditions are almost same.
2593-
# We should combine two.
2592+
# TODO: These if-block and else-block are almost same.
2593+
# MultiIndex instance check is removable, but it seems that there are
2594+
# some processes only for non-MultiIndex in else-block,
2595+
# eg. `obj.index.name != level`. We have to consider carefully whether
2596+
# these are applicable for MultiIndex. Even if these are applicable,
2597+
# we need to check if it makes no side effect to subsequent processes
2598+
# on the outside of this condition.
2599+
# (GH 17621)
25942600
if isinstance(group_axis, MultiIndex):
25952601
if is_list_like(level) and len(level) == 1:
25962602
level = level[0]

0 commit comments

Comments
 (0)