-
-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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
BUG: column selection in GroupBy NOT returning tuple when grouping by a list containing single element #53500
Closed
2 of 3 tasks
Comments
GianlucaFicarelli
added
Bug
Needs Triage
Issue that has not been reviewed by a pandas team member
labels
Jun 2, 2023
Installed Versions
|
Yeah, this looks like a bug. A PR would be welcome. |
topper-123
removed
the
Needs Triage
Issue that has not been reviewed by a pandas team member
label
Jun 3, 2023
I believe this is because when doing |
4 tasks
take |
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
Result:
Issue Description
After the change in #47761, when grouping by a list containing a single element, a tuple of one element is returned.
However, if a column selection is specified after groupby, a tuple is not returned (an int is returned in the previous example).
Expected Behavior
For consistency, I would expect that a tuple is returned also in the second case.
Installed Versions
INSTALLED VERSIONS
commit : 965ceca
python : 3.10.8.final.0
python-bits : 64
OS : Linux
OS-release : 3.10.0-1160.42.2.el7.x86_64
Version : #1 SMP Tue Aug 31 20:15:00 UTC 2021
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : en_US.UTF-8
LANG : en_US.UTF-8
LOCALE : en_US.UTF-8
pandas : 2.0.2
numpy : 1.24.3
pytz : 2023.3
dateutil : 2.8.2
setuptools : 67.7.2
pip : 23.1.2
Cython : None
pytest : None
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : None
IPython : 8.11.0
pandas_datareader: None
bs4 : None
bottleneck : 1.3.7
brotli : None
fastparquet : None
fsspec : None
gcsfs : None
matplotlib : 3.7.1
numba : 0.57.0
numexpr : 2.8.4
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : None
pyreadstat : None
pyxlsb : None
s3fs : None
scipy : 1.10.1
snappy : None
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : None
zstandard : None
tzdata : 2023.3
qtpy : None
pyqt5 : None
The text was updated successfully, but these errors were encountered: