BUG: Error in apply operation on groupby if subset of columns are selected #42899
Closed
2 of 3 tasks
Labels
Duplicate Report
Duplicate issue or pull request
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pandas.
(optional) I have confirmed this bug exists on the master branch of pandas.
Code Sample, a copy-pastable example
Problem description
In the snippet above
x
works and contains list of arrays as expected. In the next line, selecting subset of columns in theDataFrameGroupBy
object then performing the same operations should also work as expected. However,y
raises following error:Expected Output
y
would be a list of array containing only selected columns (as specified).Related issues
#18930
Output of
pd.show_versions()
INSTALLED VERSIONS
commit : f00ed8f
python : 3.9.6.final.0
python-bits : 64
OS : Linux
OS-release : 5.13.5-1-MANJARO
Version : #1 SMP PREEMPT Mon Jul 26 07:43:29 UTC 2021
machine : x86_64
processor :
byteorder : little
LC_ALL : None
LANG : en_US.utf8
LOCALE : en_US.UTF-8
pandas : 1.3.0
numpy : 1.20.3
pytz : 2021.1
dateutil : 2.8.2
pip : 21.2.2
setuptools : 52.0.0.post20210125
Cython : None
pytest : None
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : 3.0.1
IPython : 7.26.0
pandas_datareader: None
bs4 : None
bottleneck : 1.3.2
fsspec : 2021.07.0
fastparquet : None
gcsfs : None
matplotlib : None
numexpr : 2.7.3
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : None
pyxlsb : None
s3fs : None
scipy : 1.7.0
sqlalchemy : None
tables : None
tabulate : None
xarray : 0.19.0
xlrd : None
xlwt : None
numba : 0.53.1
The text was updated successfully, but these errors were encountered: