-
-
Notifications
You must be signed in to change notification settings - Fork 17.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BUG: crosstab with duplicate column or index labels #37997
Conversation
…osstab_dup_names
pandas/core/reshape/pivot.py
Outdated
Given a list of row or column names, creates a mapper of unique names to | ||
column/row names. | ||
|
||
Parameters |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addressed
pandas/core/reshape/pivot.py
Outdated
raise ValueError("values cannot be used without an aggfunc.") | ||
# We create our own mapping of row and columns names | ||
# to prevent issues with duplicate columns/row names. GH Issue: #22529 | ||
shared_col_row_names = set(rownames).intersection(set(colnames)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addressed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good thanks for picking this up. comments & ping on green.
def _build_names_mapper( | ||
rownames: List[str], colnames: List[str] | ||
) -> Tuple[Dict[str, str], List[str], Dict[str, str], List[str]]: | ||
def get_duplicates(names): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you add a doc-string here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Green + addressed comments |
Picking up from #28474
cc @jreback in case this can go in in time for 1.2