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

ENH: Resolutions for month/qtr/year #34587

Merged
merged 16 commits into from
Jun 9, 2020
Merged

Conversation

jbrockmendel
Copy link
Member

This does three things

  1. Use Resolution objects instead of strings in the places in core.indexes. This makes whats going on much clearer.
  2. To make 1) possible, extend Resolution to include month, quarter, and year. This means that pd.period_range("2017", periods=3, freq="A").resolution is now "year" instead of "day", which is more accurate.
  3. with year/quarter/month added, Resolution and FreqGroup will be re-labellings of each other, so we can de-duplicate them. They will end up living in tslibs.dtypes.

@pep8speaks
Copy link

pep8speaks commented Jun 5, 2020

Hello @jbrockmendel! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2020-06-09 21:06:34 UTC

@jorisvandenbossche
Copy link
Member

Some questions:

  • To be able to de-duplicate with FreqGroup, wouldn't you also need to add weekly and business-day resolution?
  • Since resolution is used for string datetime indexing, how does this change affect that (or not) ?

@jbrockmendel
Copy link
Member Author

To be able to de-duplicate with FreqGroup, wouldn't you also need to add weekly and business-day resolution?

Yep, oversight on my part. Weekly we could reasonably add to Resolution, but Business makes less sense. De-duplication may not be viable after all.

Since resolution is used for string datetime indexing, how does this change affect that (or not) ?

It does not affect the behavior. Adding the month/quarter/year resos is what allows us to use Resolution objects in the relevant indexing code without changing any behavior.

@jreback jreback added the Frequency DateOffsets label Jun 5, 2020
@jreback jreback added this to the 1.1 milestone Jun 5, 2020
Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

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

ok if/elif and needs a rebase

@jbrockmendel
Copy link
Member Author

rebased+green

@jreback jreback merged commit 3334c8c into pandas-dev:master Jun 9, 2020
@jreback
Copy link
Contributor

jreback commented Jun 9, 2020

thanks!

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Frequency DateOffsets
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants