We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
pivot_table
margins=True
NaN
Period
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
The following code reproduces the issue:
import pandas as pd df = pd.DataFrame( { "a": [1, 1, 2, 2], "b": [ pd.Period("2019Q1"), pd.Period("2019Q2"), pd.Period("2019Q1"), pd.Period("2019Q2"), ], "x": 1.0, } ) df.pivot_table(index="a", columns="b", values="x", margins=True)
Output:
b 2019Q1 2019Q2 All a 1 1.0 1.0 1.0 2 1.0 1.0 1.0 All NaN NaN 1.0
Expected output:
b 2019Q1 2019Q2 All a 1 1.0 1.0 1.0 2 1.0 1.0 1.0 All 1.0 1.0 1.0
The text was updated successfully, but these errors were encountered:
Thanks for the note. If you'd like to investigate and submit a PR would certainly welcome that
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
The following code reproduces the issue:
Output:
Expected output:
The text was updated successfully, but these errors were encountered: