-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
as_index = False not working for applying groupby rolling agg to DataFrame #31007
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
as_index = False
not working for applying groupby rolling agg to DataFrame
@simonjayhawkins This has actually a different origin. The Edit: That was a bit misleading. The actual aggregeation is done the same way. But the process steps after the aggregation are completly different. The rolling part runs into |
I'm not sure what the right output here is. On the one hand, doing On other other hand, users often seem confused that |
I agree. It is more sensible to ignore |
Agreed that fixing the inconsistency is positive, but I think we want to avoid changing behavior on users as a bugfix and then changing it again as a bugfix if we can just do it all at once. |
Fair enough. I can make changes so that all |
Problem description
When using a rolling agg function on a groupby object, we cannot ommit the groupby columns from the resulting dataframe's index using
as_index = False
, like we can when applying a non-rolling agg function.Code Sample
Expected Output
Actual Output
Output of
pd.show_versions()
INSTALLED VERSIONS
commit : None
python : 3.7.3.final.0
python-bits : 64
OS : Darwin
OS-release : 18.7.0
machine : x86_64
processor : i386
byteorder : little
LC_ALL : None
LANG : None
LOCALE : en_US.UTF-8
pandas : 0.25.1
numpy : 1.17.4
pytz : 2019.3
dateutil : 2.8.0
pip : 19.3.1
setuptools : 40.8.0
Cython : 0.29.14
pytest : 5.3.2
hypothesis : None
sphinx : 2.3.0
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : 1.0.1
pymysql : None
psycopg2 : 2.8.4 (dt dec pq3 ext lo64)
jinja2 : 2.10.3
IPython : 7.10.2
pandas_datareader: None
bs4 : 4.8.1
bottleneck : None
fastparquet : None
gcsfs : None
lxml.etree : None
matplotlib : 3.1.2
numexpr : 2.7.1
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : 0.15.1
pytables : None
s3fs : None
scipy : 1.3.0
sqlalchemy : 1.3.11
tables : 3.6.1
xarray : None
xlrd : None
xlwt : None
xlsxwriter : None
The text was updated successfully, but these errors were encountered: