Skip to content

REGR: DataFrame.resample fails on a frame with no columns #52615

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

Merged
merged 12 commits into from
Apr 20, 2023

Conversation

rhshadrach
Copy link
Member

@rhshadrach rhshadrach added Regression Functionality that used to work in a prior pandas version Resample resample method labels Apr 12, 2023
@rhshadrach rhshadrach added this to the 2.0.1 milestone Apr 12, 2023
name="date",
)
)
result = df.groupby([0, 0, 1]).resample(rule=pd.to_timedelta("06:00:00")).mean()
Copy link
Member Author

@rhshadrach rhshadrach Apr 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some very odd behavior here. When I specify the groupings via a list ([0, 0, 1]), this gets encoded as a 32-bit int in the index of the result only on 64-bit Windows.

https://github.com/pandas-dev/pandas/actions/runs/4713463284/jobs/8359178465?pr=52615#step:5:267

@rhshadrach rhshadrach requested a review from mroeschke April 20, 2023 02:33
@mroeschke mroeschke merged commit e44daed into pandas-dev:main Apr 20, 2023
@mroeschke
Copy link
Member

Thanks @rhshadrach

@lumberbot-app
Copy link

lumberbot-app bot commented Apr 20, 2023

Owee, I'm MrMeeseeks, Look at me.

There seem to be a conflict, please backport manually. Here are approximate instructions:

  1. Checkout backport branch and update it.
git checkout 2.0.x
git pull
  1. Cherry pick the first parent branch of the this PR on top of the older branch:
git cherry-pick -x -m1 e44daed32234b1afd263e5880a7e743f31218ad1
  1. You will likely have some merge/cherry-pick conflict here, fix them and commit:
git commit -am 'Backport PR #52615: REGR: DataFrame.resample fails on a frame with no columns'
  1. Push to a named branch:
git push YOURFORK 2.0.x:auto-backport-of-pr-52615-on-2.0.x
  1. Create a PR against branch 2.0.x, I would have named this PR:

"Backport PR #52615 on branch 2.0.x (REGR: DataFrame.resample fails on a frame with no columns)"

And apply the correct labels and milestones.

Congratulations — you did some good work! Hopefully your backport PR will be tested by the continuous integration and merged soon!

Remember to remove the Still Needs Manual Backport label once the PR gets merged.

If these instructions are inaccurate, feel free to suggest an improvement.

mroeschke pushed a commit to mroeschke/pandas that referenced this pull request Apr 20, 2023
mroeschke added a commit that referenced this pull request Apr 20, 2023
… a frame with no columns) (#52804)

* Backport PR #52615: REGR: DataFrame.resample fails on a frame with no columns

* Update pandas/tests/resample/test_resample_api.py

* Update pandas/tests/resample/test_resample_api.py

---------

Co-authored-by: Richard Shadrach <[email protected]>
@rhshadrach rhshadrach deleted the empty_resample_regr branch April 21, 2023 02:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Regression Functionality that used to work in a prior pandas version Resample resample method
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: resample on empty DataFrame leads to ValueError
2 participants