-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: values
argument ignored when also supplied to index
/columns
in pivot_table
#61292
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
Open
3 tasks done
Comments
it176131
added a commit
to it176131/pandas
that referenced
this issue
Apr 15, 2025
- Added GH issue pandas-dev#61292 as comment to test :func:`test_pivot_table_multiindex_values_as_two_params`.
6 tasks
it176131
added a commit
to it176131/pandas
that referenced
this issue
Apr 16, 2025
- Added GH issue pandas-dev#61292 as comment to test :func:`test_pivot_table_multiindex_values_as_two_params`.
it176131
added a commit
to it176131/pandas
that referenced
this issue
Apr 16, 2025
- Added GH issue pandas-dev#61292 as comment to test :func:`test_pivot_table_multiindex_values_as_two_params`.
it176131
added a commit
to it176131/pandas
that referenced
this issue
Apr 16, 2025
- Added pivot_table bug to Bugs/Reshaping section referencing issues pandas-dev#57876 and pandas-dev#61292.
it176131
added a commit
to it176131/pandas
that referenced
this issue
Apr 19, 2025
- Added GH issue pandas-dev#61292 as comment to test :func:`test_pivot_table_multiindex_values_as_two_params`.
it176131
added a commit
to it176131/pandas
that referenced
this issue
Apr 19, 2025
- Added pivot_table bug to Bugs/Reshaping section referencing issues pandas-dev#57876 and pandas-dev#61292.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Pandas version checks
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pandas.
I have confirmed this bug exists on the main branch of pandas.
Reproducible Example
Issue Description
When the column supplied to
values
inpandas.DataFrame.pivot_table
is also supplied toindex
orcolumns
, the resultingDataFrame
does not contain the aggregations of thevalues
argument. If any extra column(s) are present, those columns are aggregated instead of those supplied tovalues
. This is similar to issue #57876, but the additional columns result in a non-emptyDataFrame
.Expected Behavior
I would expect the two tests above to pass, i.e., the
values
arg is aggregated instead of the non-supplied "extra" column.Installed Versions
INSTALLED VERSIONS
commit : 0691c5c
python : 3.13.3
python-bits : 64
OS : Windows
OS-release : 11
Version : 10.0.22631
machine : AMD64
processor : AMD64 Family 25 Model 116 Stepping 1, AuthenticAMD
byteorder : little
LC_ALL : None
LANG : None
LOCALE : English_United States.1252
pandas : 2.2.3
numpy : 2.2.4
pytz : 2025.2
dateutil : 2.9.0.post0
pip : 25.0.1
Cython : None
sphinx : None
IPython : 9.1.0
adbc-driver-postgresql: None
adbc-driver-sqlite : None
bs4 : 4.13.3
blosc : None
bottleneck : None
dataframe-api-compat : None
fastparquet : None
fsspec : None
html5lib : None
hypothesis : None
gcsfs : None
jinja2 : 3.1.6
lxml.etree : None
matplotlib : None
numba : None
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
psycopg2 : None
pymysql : None
pyarrow : None
pyreadstat : None
pytest : 8.3.5
python-calamine : None
pyxlsb : None
s3fs : None
scipy : 1.15.2
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : None
xlsxwriter : None
zstandard : None
tzdata : 2025.2
qtpy : None
pyqt5 : None
The text was updated successfully, but these errors were encountered: