-
-
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
DOC/BUG? pivot functionality confusing/inconsistent #8160
Labels
Comments
Re # 2. See also https://groups.google.com/forum/#!topic/pydata/hjv_KeeuKsA, where the issue is that |
For the first one, yes the docstring should remove the reference to "this dataframe" |
this works now In [2]: pivot_table(df, index='FooBar', columns=['TLA', 'Letter'], values='Number')
Out[2]: #
TLA ABC XYZ
Letter A B X Y
FooBar
bar NaN 5.0 6.0 NaN
foo 1.0 2.0 3.0 4.0
In [3]: df.pivot(index='FooBar', columns=['TLA', 'Letter'], values='Number')
Out[3]:
TLA ABC XYZ
Letter A B X Y
FooBar
bar NaN 5.0 6.0 NaN
foo 1.0 2.0 3.0 4.0 and the current docstring doesn't mention "this dataframe", so let's close |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
pivot()
function, http://pandas.pydata.org/pandas-docs/stable/generated/pandas.pivot.html#pandas.pivot, saysProduce ‘pivot’ table based on 3 columns of this DataFrame. Uses unique values from index / columns and fills with values.
But there is no DataFrame argument, and so no "this DataFrame". Is this an internal function that shouldn't be exposed? Or is the docstring wrong?pivot_table()
supports specifying multiple columns forcolumns
, so that the resulting table has multi-index columns,DataFrame.pivot()
does not. Any reason it doesn't? I would have expected the two functions to behave similarly. Granted, the docstring forDataFrame.pivot()
doesn't claim that it supports multiple columns forcolumns
, so this isn't a bug, but it does seem inconsistent (and restrictive) vs.pivot_table()
.This is with Pandas v0.14.1.
The text was updated successfully, but these errors were encountered: