-
-
Notifications
You must be signed in to change notification settings - Fork 17.4k
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
Pandas date_range error when the date falls in a DST starting day. #30378
Comments
I iterated through all timezones and got that this list of timezones fail too: America/Asuncion |
What's the expected behavior here? If the user is trying to create an invalid datetime, shouldn't we raise? |
The same behaviour used when this exact same bug happened with the resample method in the 0.23.x version.
|
What was the resolution there? Can you post the actual expected output in the original post? |
In the resample case, an assumption was made on the behavior of ambiguous and nonexistent timezones since the resulting index is a transformation from the original index (i.e the binning). In the
I think ultimately the |
I don't think that deprecating the start = pd.Timestamp("2016-10-05").tz_localize("America/Sao_Paulo")
end = pd.Timestamp("2016-10-30").tz_localize("America/Sao_Paulo")
pd.date_range(start=start, end=end, freq="D")
I think pd.Series(1, index=pd.date_range(start, end, freq="h")).resample("D").sum().index which returns:
Notice that the index for 2016-10-16 is shifted by 1 hour. |
Code Sample
Problem description
[When I try to generate a range of daily data with America/Sao_Paulo timezone, it breaks with NonExistentTimeError: 2016-10-16 00:00:00. My pandas version is 0.25.3]
The text was updated successfully, but these errors were encountered: