Skip to content

BUG: PeriodIndex.to_datetime inconsistent with its docstring #60350

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

Conversation

aram-cedarwood
Copy link
Contributor

new_data = libperiod.periodarr_to_dt64arr(new_parr.asi8, base)
is_start = how == "S"
if is_start:
new_data = np.asarray(
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
new_data = np.asarray(
new_data = new_parr.dt.start_time

the list comprehension is going to be prohibitively slow (might be the cause of the current ASV failures). If you can use the vectorized datetimeindex (DTI) methods we have, I think that might fix things

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hey thanks @WillAyd, I'll have more time later to look into this, but for now...
new_parr.dt.start_time gives AttributeError: 'PeriodArray' object has no attribute 'dt'
new_parr.start_time gives RecursionError: maximum recursion depth exceeded while calling a Python object

Copy link
Contributor

This pull request is stale because it has been open for thirty days with no activity. Please update and respond to this comment if you're still interested in working on this.

@github-actions github-actions bot added the Stale label Jan 16, 2025
@mroeschke
Copy link
Member

Thanks for the pull request, but it appears to have gone stale. If interested in continuing, please merge in the main branch, address any review comments and/or failing tests, and we can reopen.

@mroeschke mroeschke closed this Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: PeriodIndex.to_timestamp inconsistent with its docstring
3 participants