-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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
DOC/BUG: pivot_table returns Series in specific circumstance #4386
Comments
@davidshinn want to do a PR for this? |
Hi calling |
if u would like to implement as indicated above that would be great |
@youlyst, feel free to do a PR to fix this. Sorry I've been out of touch since I originally posted. If no one gets to this by February, I'll submit a PR so that pivot_table always returns a DataFrame for consistency. |
I do not feel for it yet, i am working with pandas very short time. but it could change after month... |
contributing docs are: http://pandas.pydata.org/pandas-docs/stable/contributing.html |
Before this commit, if * `values` is not list like * `columns` is `None` * `aggfunc` is not instance of `list` `pivot_table` returns a `Series`. This commit adds checking for `columns.nlevels` is greater than 1 to prevent from casting `table` to a `Series`. This will fix pandas-dev#4386.
BUG: pivot_table sometimes returns Series (pandas-dev#4386) BUG: pivot_table sometimes returns Series (pandas-dev#4386)
BUG: pivot_table sometimes returns Series (pandas-dev#4386) BUG: pivot_table sometimes returns Series (pandas-dev#4386)
BUG: pivot_table someitmes returns Series (pandas-dev#4386) BUG: pivot_table sometimes returns Series (pandas-dev#4386) BUG: pivot_table sometimes returns Series (pandas-dev#4386) pep 8 fixes Restructure condional and update whatsnew
Before this commit, if * `values` is not list like * `columns` is `None` * `aggfunc` is not instance of `list` `pivot_table` returns a `Series`. This commit adds checking for `columns.nlevels` is greater than 1 to prevent from casting `table` to a `Series`. This will fix pandas-dev#4386.
Before this commit, if * `values` is not list like * `columns` is `None` * `aggfunc` is not instance of `list` `pivot_table` returns a `Series`. This commit adds checking for `columns.nlevels` is greater than 1 to prevent from casting `table` to a `Series`. This will fix pandas-dev#4386.
Before this commit, if * `values` is not list like * `columns` is `None` * `aggfunc` is not instance of `list` `pivot_table` returns a `Series`. This commit adds checking for `columns.nlevels` is greater than 1 to prevent from casting `table` to a `Series`. This will fix pandas-dev#4386.
Before this commit, if * `values` is not list like * `columns` is `None` * `aggfunc` is not instance of `list` `pivot_table` returns a `Series`. This commit adds checking for `columns.nlevels` is greater than 1 to prevent from casting `table` to a `Series`. This will fix pandas-dev#4386. DOC: add docs for pandas-dev#13554
The docstrings and other documentation say that the
pivot_table
function returns a DataFrame. However, this likely leads to confusion like #4371, because under narrow circumstances, passing a certain set of argument dtypes results in the function returning a Series (see ipython examples at end):Unfortunately, this is not clear from the docs or from normal use (except for condition 1).
Should this:
My thoughts are changing the function to return only a DataFrame in future versions (> 0.13) and providing some deprecation warning in the meantime is better than trying to explain this in the docs.
I would be happy to provide the deprecation warning and document notes as a pull request.
Thanks.
The text was updated successfully, but these errors were encountered: