Skip to content
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

BUG: groupby.rolling.sem() doesn't handle as_index=False parameter correctly #6291

Open
3 tasks done
dchigarev opened this issue Jun 26, 2023 · 0 comments
Open
3 tasks done
Labels
bug 🦗 Something isn't working P2 Minor bugs or low-priority feature requests pandas concordance 🐼 Functionality that does not match pandas

Comments

@dchigarev
Copy link
Collaborator

dchigarev commented Jun 26, 2023

Modin version checks

  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest released version of Modin.

  • I have confirmed this bug exists on the main branch of Modin. (In order to do this you can follow this guide.)

Reproducible Example

import modin.pandas as pd

md_df = pd.DataFrame({"a": [1, 1, 1, 2, 2, 2], "b": [3, 4, 5, 6, 7, 8]})
pd_df = md_df._to_pandas()

md_res = md_df.groupby("a", as_index=False).rolling(2).sem()
pd_res = pd_df.groupby("a", as_index=False).rolling(2).sem()

print(md_res)
# the 'a' column is NOT involved in the aggregation
#    a         b
# 0  1       NaN
# 1  1  0.707107
# 2  1  0.707107
# 3  2       NaN
# 4  2  0.707107
# 5  2  0.707107

print(pd_res)
# the 'a' column involved in the aggregation
#      a         b
# 0  inf       NaN
# 1  inf  0.707107
# 2  inf  0.707107
# 3  2.0       NaN
# 4  2.0  0.707107
# 5  2.0  0.707107

Issue Description

In the groupby.rolling.sem() implementation introduced in #6292, there's a mismatch in how as_index=False parameter is handled. In pandas the group columns appear to be aggregated and in modin's implementation they're not.

Expected Behavior

To act as pandas.

Error Logs

N/A

Installed Versions

Replace this line with the output of pd.show_versions()

@dchigarev dchigarev added bug 🦗 Something isn't working P2 Minor bugs or low-priority feature requests labels Jun 26, 2023
@mvashishtha mvashishtha added the pandas concordance 🐼 Functionality that does not match pandas label Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🦗 Something isn't working P2 Minor bugs or low-priority feature requests pandas concordance 🐼 Functionality that does not match pandas
Projects
None yet
Development

No branches or pull requests

2 participants