You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When ['a', 'd'] is selected, the result should only contain column a and d. However, this selection has no effect on the result produced by groupby-sample.
@wjsi Thanks for the bug report! I can reproduce this on master. This problem seems to be limited to sample. For example when I do
>>> df1.groupby('c')[['a', 'd']].max()
a d
c
0 6 2
1 3 9
3 1 6
4 4 8
5 7 5
8 5 7
column selection works.
lithomas1
added
Groupby
Algos
Non-arithmetic algos: value_counts, factorize, sorting, isin, clip, shift, diff
Reshaping
Concat, Merge/Join, Stack/Unstack, Explode
and removed
Needs Triage
Issue that has not been reviewed by a pandas team member
labels
Feb 24, 2021
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
When
['a', 'd']
is selected, the result should only contain columna
andd
. However, this selection has no effect on the result produced bygroupby-sample
.Expected Output
Output of
pd.show_versions()
INSTALLED VERSIONS
commit : 7d32926
python : 3.8.5.final.0
python-bits : 64
OS : Darwin
OS-release : 19.6.0
Version : Darwin Kernel Version 19.6.0: Tue Jan 12 22:13:05 PST 2021; root:xnu-6153.141.16~1/RELEASE_X86_64
machine : x86_64
processor : i386
byteorder : little
LC_ALL : None
LANG : None
LOCALE : zh_CN.UTF-8
pandas : 1.2.2
numpy : 1.19.1
pytz : 2021.1
dateutil : 2.8.1
pip : 20.2.2
setuptools : 49.6.0.post20200814
Cython : 0.29.21
pytest : 6.0.1
hypothesis : None
sphinx : 3.2.1
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : 2.11.2
IPython : 7.17.0
pandas_datareader: None
bs4 : None
bottleneck : None
fsspec : None
fastparquet : 0.4.2
gcsfs : None
matplotlib : 3.2.2
numexpr : 2.7.1
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : 1.0.1
pyxlsb : None
s3fs : None
scipy : 1.6.0
sqlalchemy : 1.3.18
tables : None
tabulate : None
xarray : None
xlrd : None
xlwt : None
numba : 0.51.2
The text was updated successfully, but these errors were encountered: