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
Using pd.Grouper with a datetime key in conjunction with another key creates a set of groups, but this does not seem to encompass all of the groups that need to be created, in my opinion.
g.groups shows only 2 groups when I expected 4 groups -- both "a" and "b" for each day, whereas g.ngroups and g.size() return the correct results.
I believe this issue is confined to using a datetime key as replacing the the datetime key with a categorical key, which is based off of the datetime key, produces the correct result (see ## 2 ##).
Expected Behavior
g.groups.keys() must show all 4 keys.
Installed Versions
INSTALLED VERSIONS
commit : 2e218d1
python : 3.10.8.final.0
python-bits : 64
OS : Linux
OS-release : 5.15.0-58-generic
Version : #64-Ubuntu SMP Thu Jan 5 11:43:13 UTC 2023
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : None
LANG : en_US.UTF-8
LOCALE : en_US.UTF-8
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
Using pd.Grouper with a datetime key in conjunction with another key creates a set of groups, but this does not seem to encompass all of the groups that need to be created, in my opinion.
g.groups shows only 2 groups when I expected 4 groups -- both "a" and "b" for each day, whereas
g.ngroups
andg.size()
return the correct results.I believe this issue is confined to using a datetime key as replacing the the datetime key with a categorical key, which is based off of the datetime key, produces the correct result (see ## 2 ##).
Expected Behavior
g.groups.keys()
must show all 4 keys.Installed Versions
INSTALLED VERSIONS
commit : 2e218d1
python : 3.10.8.final.0
python-bits : 64
OS : Linux
OS-release : 5.15.0-58-generic
Version : #64-Ubuntu SMP Thu Jan 5 11:43:13 UTC 2023
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : None
LANG : en_US.UTF-8
LOCALE : en_US.UTF-8
pandas : 1.5.3
numpy : 1.24.1
pytz : 2022.7.1
dateutil : 2.8.2
setuptools : 67.1.0
pip : 23.0
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.1.2
IPython : 8.9.0
pandas_datareader: None
bs4 : 4.11.1
bottleneck : None
brotli :
fastparquet : None
fsspec : None
gcsfs : None
matplotlib : 3.6.3
numba : None
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : None
pyreadstat : None
pyxlsb : None
s3fs : None
scipy : 1.10.0
snappy : None
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : None
xlwt : None
zstandard : 0.19.0
tzdata : 2022.7
The text was updated successfully, but these errors were encountered: