-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
BUG/API: pivot_table with multi-index columns only #17038
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
Comments
This did sort of work in previous versions - arguably returning the wrong shape, but didn't error. In [5]: df = pd.DataFrame({'k1': [1, 2, 3], 'k2': [1, 2, 3], 'v': [4, 5, 6]})
In [6]: df.pivot_table(values='v', columns=('k1','k2'))
Out[6]:
k1 k2
1 1 4
2 2 5
3 3 6
dtype: int64
In [7]: df.pivot_table(values='v', index=('k1','k2'))
Out[7]:
k1 k2
1 1 4
2 2 5
3 3 6
Name: v, dtype: int64
In [8]: pd.__version__
Out[8]: '0.18.1' |
Have the same problem after updated from pandas 0.19.2 to 0.20.3. Python 3.5.2 The problem starts when adding more than 1 column to the columns parameter.
While: Currently downgrading to get the wanted result back. |
@sroodhorst are you sure that is the correct output on 0.19.2? (or can you provide a small reproducible example) |
By the way, a PR to try to fix this is very welcome! |
I am working on this. |
Will this be fixed soon? Seems like it would affect a lot of code for some. |
@bryaan best way to have things fixed is to submit a PR |
@jreback Sure is, I don't mean to complain. Just surprised a widely used lib like pandas would have this issue in a release branch. |
As you can see, we have a lot of open issues. It comes down to who in the community has the time to fix them (do you have time?). |
Just seeking info: is this bug still not solved or is there a non released version which fixes it ? |
Still open. Issues are closed when the fix is merged into master, and
assigned that release as the milestone.
…On Mon, Jul 2, 2018 at 3:25 PM, Mahdi Ben Jelloul ***@***.***> wrote:
Just seeking info: is this bug still not solved or is there a non released
version which fixes it ?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#17038 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABQHIsbRIcpr8I0jM1kEWOwZWSpwQtmwks5uCoHPgaJpZM4OeFpw>
.
|
Code Sample, a copy-pastable example if possible
Expected Output
No error, symmetrical between rows/columns and single/multi case
Output of
pd.show_versions()
pandas 0.20.2
The text was updated successfully, but these errors were encountered: