-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Closed
Labels
Duplicate ReportDuplicate issue or pull requestDuplicate issue or pull request
Description
import pandas as pd
## two timepoints in UTC flanking the US/Eastern DST shift
date_strings = ['2015-11-01T05:00:00Z', '2015-11-01T07:00:00Z']
S = pd.Series(date_strings)
## Convert to US/Eastern
S = pd.to_datetime(S).apply(lambda x: x.tz_localize('UTC').tz_convert('US/Eastern'))
S.dt.dayofweek
## AttributeError: Can only use .dt accessor with datetimelike values
## Note: the problem does not arise if the US/Eastern version of the times are on different days
## e.g. if date_strings = ['2015-11-01T03:00:00Z', '2015-11-01T07:00:00Z']
Using python 3.4 and pandas 0.17.0.
When a Series contains two time-zone aware datetimes on the 'same day' in the local time zone on either side of the Fall 2015 daylight savings time shift, calling .dt produces an attribute error.
Metadata
Metadata
Assignees
Labels
Duplicate ReportDuplicate issue or pull requestDuplicate issue or pull request