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
BUG: groupby.rolling: Originial index is not being preserved when using date_part of DatetimeIndex and as_index key word seems to have no effect
#39433
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.
When using a date part like df.index.weekday to group by and using some rolling window function like .mean() the original datetime index is not part of the resulting frames index anymore.
The group by keyword argumen as_index seems to have no effect in that situation anymore
I have checked that this issue has not already been reported.
[ x] 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
Comparing pandas 1.0.1 and 1.2.1 yields:
Expected Output
['id', 'date', 'date']
[None, 'date']
['id', 'date']
[None, 'date']
Output of
pd.show_versions()
INSTALLED VERSIONS
commit : 9d598a5
python : 3.8.4.final.0
python-bits : 64
OS : Linux
OS-release : 4.15.0-45-generic
Version : #48-Ubuntu SMP Tue Jan 29 16:28:13 UTC 2019
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : None
LANG : en_US.UTF-8
LOCALE : en_US.UTF-8
pandas : 1.2.1
numpy : 1.19.1
The text was updated successfully, but these errors were encountered: