Skip to content

BUG: Resampler attempts to aggregate the on column #47107

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 2 commits into from
May 27, 2022

Conversation

rhshadrach
Copy link
Member

In main, following methods will aggregate the on column

  • first
  • count
  • last
  • max
  • min
  • nunique

whereas it will necessarily fail to aggregate with

  • median
  • sem
  • sum
  • prod
  • std
  • quantile
  • mean
  • var

When we change the default to numeric_only=False and have ops fail instead of silently dropping nuisance columns, the latter methods would always raise. So I think our only option here is to not aggregate the on column; and this I think is what a user would expect anyways.

@rhshadrach rhshadrach added Bug Resample resample method Reduction Operations sum, mean, min, max, etc. labels May 24, 2022
@rhshadrach rhshadrach added this to the 1.5 milestone May 24, 2022
@jreback jreback merged commit b591523 into pandas-dev:main May 27, 2022
@rhshadrach rhshadrach deleted the resampler_exclusions branch May 27, 2022 13:18
yehoshuadimarsky pushed a commit to yehoshuadimarsky/pandas that referenced this pull request Jul 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Reduction Operations sum, mean, min, max, etc. Resample resample method
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: resample ops includes sampled column
2 participants