-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Series with NAMED period index raise error on groupby index.month (pandas 1.0 specific) #32108
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
Comments
Thanks @daxid Couldn't reproduce this on master, seems it's already been fixed
(please don't close this yet though, I still haven't checked if there is a test for this) |
I can confirm it runs OK with the last code on master (pandas-1.1.0.dev0+516.gac3056f2f) I'll let it open until you check for related tests. Best regards |
So we need to check if it also already passes on the 1.0.x branch, or if we need to find the commit on master that fixed this to backport. |
I installed the 1.0.x branch and the sample code fails ! I guess you have to go for a cherry pick 🍒 I'll give a shot to test writing. I'll report progress here, probably within a week. |
Just checking this but I think it was fixed by #31318 EDITyup, seems to be the case - @daxid thanks, tests would be welcome!
|
Backporting #31318 doesn't look straightforward, so this likely won't be fixed for 1.0.2 unless someone invests some time in the next day or so. I'll repurpose this issue to adding a test for the behavior on master. |
Thanks for feedback. |
take |
@MarcoGorelli Request you to review. |
Too bad, my colleague and I had a test ready since Monday. @MarcoGorelli to review, test should pass on master but fail on 2.0.x branch |
@daxid Missed it, i have closed my pull request please feel free to raise a new pull request, in case the issue is not resolved in few weeks, i will reopen my pull request. |
@daxid Please run |
This is also fixed on 1.0.x branch from backporting #34049 (i.e. 1.0.4) b3ebcb0 is the first new commit
|
edit from @TomAugspurger: this is fixed on master, but the example below needs to be added as a unit test. The test can probably go in
groupby/test_groupby.py
.Description
With the pandas 1.0.1 (full version with dependencies at the end), series with NAMED period index raise error on groupby index.month
There is no error if the index is not named.
There was no error wit pandas 0.25.3
Code Sample
Error
It seems to me that pandas tries to interpret the index name as if it were part of the index itself.
Expected Output
With pandas 0.25.3, the following expected output is produced :
Output of
pd.show_versions()
INSTALLED VERSIONS
commit : None
python : 3.8.1.final.0
python-bits : 64
OS : Linux
OS-release : 5.4.18-1-MANJARO
machine : x86_64
processor :
byteorder : little
LC_ALL : None
LANG : fr_FR.UTF-8
LOCALE : fr_FR.UTF-8
pandas : 1.0.1
numpy : 1.18.0
pytz : 2019.3
dateutil : 2.8.1
pip : 20.0.2
setuptools : 44.0.0
Cython : 0.29.15
pytest : None
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : 2.10.3
IPython : 7.11.1
pandas_datareader: None
bs4 : None
bottleneck : None
fastparquet : None
gcsfs : None
lxml.etree : None
matplotlib : 3.1.2
numexpr : None
odfpy : None
openpyxl : 3.0.2
pandas_gbq : None
pyarrow : None
pytables : None
pytest : None
pyxlsb : None
s3fs : None
scipy : 1.4.1
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : 1.2.0
xlwt : None
xlsxwriter : None
numba : None
The text was updated successfully, but these errors were encountered: