8000 REF: Simplify Period/Datetime Array/Index constructors by jbrockmendel · Pull Request #23093 · pandas-dev/pandas · GitHub
[go: up one dir, main page]

Skip to content

REF: Simplify Period/Datetime Array/Index constructors #23093

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 6 commits into from
Oct 12, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
override simple_new instead of _from_ordinasl
  • Loading branch information
jbrockmendel committed Oct 11, 2018
commit 69a8f7ec6fc0b12fc63739a3aaf95d85911c080d
8 changes: 2 additions & 6 deletions pandas/core/indexes/period.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,12 +239,8 @@ def _engine(self):
return self._engine_type(lambda: self, len(self))

@classmethod
def _from_ordinals(cls, values, freq=None, name=None, **kwargs):
"""
Values should be int ordinals
`__new__` & `_simple_new` cooerce to ordinals and call this method
"""
result = super(PeriodIndex, cls)._from_ordinals(values, freq)
def _simple_new(cls, values, freq=None, name=None, **kwargs):
result = super(PeriodIndex, cls)._simple_new(values, freq)

result.name = name
result._reset_identity()
Expand Down
0