You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is related to issue 18319 and the associated PR which makes pandas.Timestamp.replace behaviour deviate from datetime.datetime.replace when crossing DST transitions, and generally hand them more gracefully.
In cases when replacing into an ambiguous time (as above, when the clocks go back and repeat the same time in local time), the default behaviour of pandas is to normalize the datetime, using pytz's default setting is_dst=False. It would be useful to
have a way of specifying whether to go into DST or not and override the pytz default
in the case of replacing increments less than an hour, to copy the DST info of the original datetime (since the new time could be assumed to be in the same local hour)
The text was updated successfully, but these errors were encountered:
Note Timestamp.replace has a fold argument like the PY3.6 version; however, it's just not implemented yet. It just needs to be passed into localize as is_dst=bool(fold).
For ambiguous times I believe you would want is_dst=not bool(fold) since fold = 0 refers to the first moment chronologically that time is seen on the clock locally, aka when DST is still in place
This is related to issue 18319 and the associated PR which makes
pandas.Timestamp.replace
behaviour deviate fromdatetime.datetime.replace
when crossing DST transitions, and generally hand them more gracefully.In cases when replacing into an ambiguous time (as above, when the clocks go back and repeat the same time in local time), the default behaviour of pandas is to normalize the datetime, using pytz's default setting
is_dst=False
. It would be useful toThe text was updated successfully, but these errors were encountered: