-
-
Notifications
You must be signed in to change notification settings - Fork 18k
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
Issue 21932: Added Regression Test for index of pivot_table on empty table #52809
Conversation
pandas/tests/reshape/test_pivot.py
Outdated
def test_pivot_table_empty_dataframe_correct_index(self): | ||
# GH 21932 | ||
df = DataFrame([], columns=["a", "b", "value"]) | ||
pivot = df.pivot_table(index="a", columns="b", values="value", |
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 run pre-commit? This is formatted incorrectly
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.
thx for the head up, done :)
pandas/tests/reshape/test_pivot.py
Outdated
pivot = df.pivot_table(index="a", columns="b", values="value", aggfunc="count") | ||
|
||
expected = pd.Index([], dtype="object", name="b") | ||
tm.assert_index_equal(pivot.columns, expected) |
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.
I'd suggest you run pre-commit
, please check the contributing guide for how to do that
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.
thx for the head up, done :)
thx @MirijaH |
@phofl, @noatamir, @jorisvandenbossche and @MarcoGorelli