Skip to content

DEPR: PeriodIndex ordinal, fields keywords #55963

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 4 commits into from
Nov 15, 2023

Conversation

jbrockmendel
Copy link
Member

@@ -146,7 +148,7 @@ class PeriodIndex(DatetimeIndexOpsMixin):

Examples
--------
>>> idx = pd.PeriodIndex(year=[2000, 2002], quarter=[1, 3])
>>> idx = pd.PeriodIndex.from_fields(year=[2000, 2002], quarter=[1, 3])
Copy link
Member

Choose a reason for hiding this comment

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

Could you add a .. deprecated 2.2.0 directive in the docstring for the fields?

@@ -280,6 +295,39 @@ def __new__(

return cls._simple_new(data, name=name, refs=refs)

@classmethod
def from_fields(
Copy link
Member

Choose a reason for hiding this comment

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

Could you add this method and from_ordinals to the API reference?

Copy link
Member Author

Choose a reason for hiding this comment

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

updated+green

@mroeschke mroeschke added Period Period data type Deprecate Functionality to remove in pandas labels Nov 15, 2023
@mroeschke mroeschke added this to the 2.2 milestone Nov 15, 2023
@mroeschke mroeschke merged commit 55cd96a into pandas-dev:main Nov 15, 2023
@mroeschke
Copy link
Member

Thanks @jbrockmendel

@jbrockmendel jbrockmendel deleted the depr-from-fields branch November 15, 2023 23:21
jbrockmendel added a commit to jbrockmendel/pandas that referenced this pull request Nov 15, 2023
* DEPR: PeriodIndex ordinal, fields keywords

* lint fixups

* update doctest

* doc updates
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Deprecate Functionality to remove in pandas Period Period data type
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DEPR: PeriodIndex.__new__ accepting ordinals, fields
2 participants