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

WARN/ERR: raise on .resample('1M', closed='left')? #51710

Closed
MarcoGorelli opened this issue Mar 1, 2023 · 1 comment
Closed

WARN/ERR: raise on .resample('1M', closed='left')? #51710

MarcoGorelli opened this issue Mar 1, 2023 · 1 comment
Labels
Error Reporting Incorrect or improved errors from pandas Resample resample method Warnings Warnings that appear or should be added to pandas

Comments

@MarcoGorelli
Copy link
Member

MarcoGorelli commented Mar 1, 2023

Splitting off from #5440 (comment)

If someone types .resample('1M', closed='left'), then the bins will be something like

  • 2000-02-29: [2000-02-29, 2000-03-31)
  • 2000-03-31: [2000-03-31, 2000-04-30)

Do people actually have this use case - of starting their groups on the last day of the month?

Perhaps this should warn or error, and point users towards what they almost certainly meant to write, which is

.resample('1MS', closed='left')

Related: here it's suggested to even rename 'M' to 'ME'

@MarcoGorelli MarcoGorelli added Resample resample method Warnings Warnings that appear or should be added to pandas Error Reporting Incorrect or improved errors from pandas labels Mar 1, 2023
@MarcoGorelli
Copy link
Member Author

looks like we're moving towards renaming 'M' to 'ME', so closing in favour of that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Error Reporting Incorrect or improved errors from pandas Resample resample method Warnings Warnings that appear or should be added to pandas
Projects
None yet
Development

No branches or pull requests

1 participant