Skip to content

BUG: Unable to resample period range with dates above 2262-04-11 #44326

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

Closed
3 tasks done
jmcinto opened this issue Nov 5, 2021 · 1 comment
Closed
3 tasks done

BUG: Unable to resample period range with dates above 2262-04-11 #44326

jmcinto opened this issue Nov 5, 2021 · 1 comment
Labels
Bug Needs Triage Issue that has not been reviewed by a pandas team member Period Period data type Resample resample method

Comments

@jmcinto
Copy link

jmcinto commented Nov 5, 2021

  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of pandas.

  • I have confirmed this bug exists on the master branch of pandas.

Reproducible Example

import pandas as pd
from datetime import datetime
print(pd.__version__)
rng = pd.period_range(datetime(2000, 1, 1, 0, 0), datetime(2300, 1, 1, 0, 0), freq="1D")
df = pd.DataFrame(index = rng, data = [i+1 for i in range(0,len(rng))])
resample_df = df.resample("6H").interpolate()
print(resample_df.head(5))

Issue Description

We are working with datasets that extend out past the maximum timestamp date of 2262-04-11, so we generally use period ranges rather than datetime ranges. However, starting with release 1.1.0, the resample functionality no longer works with period ranges that extend past 2262-04-11. The error that occurs in these later releases is pandas._libs.tslibs.np_datetime.OutOfBoundsDatetime: Out of bounds nanosecond timestamp: 2300-01-01 22:59:59.

Expected Behavior

In releases prior to 1.1.0, period ranges that extend past 2262-04-11 are resampled successfully without an out of bounds datetime error.

Installed Versions

1.1.1

@jmcinto jmcinto added Bug Needs Triage Issue that has not been reviewed by a pandas team member labels Nov 5, 2021
@rhshadrach rhshadrach added Period Period data type Resample resample method labels Nov 7, 2021
@mroeschke
Copy link
Member

Thanks for the report. The core issue (Period out of bound timestamps) is the same as #28104 so closing as a duplicate of that issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Needs Triage Issue that has not been reviewed by a pandas team member Period Period data type Resample resample method
Projects
None yet
Development

No branches or pull requests

3 participants