-
-
Notifications
You must be signed in to change notification settings - Fork 19.3k
Closed
Labels
API - ConsistencyInternal Consistency of API/BehaviorInternal Consistency of API/BehaviorBugConstructorsSeries/DataFrame/Index/pd.array ConstructorsSeries/DataFrame/Index/pd.array ConstructorsDatetimeDatetime data dtypeDatetime data dtype
Description
values = [pd.Timestamp(0, tz="UTC"), np.datetime64(1, "D").astype("M8[ns]")]
>>> pd.DatetimeIndex(values, tz="US/Pacific")[1:]
DatetimeIndex(['1970-01-01 16:00:00-08:00'], dtype='datetime64[ns, US/Pacific]', freq=None)
>>> pd.DatetimeIndex(values[1:], tz="US/Pacific")
DatetimeIndex(['1970-01-02 00:00:00-08:00'], dtype='datetime64[ns, US/Pacific]', freq=None)In array_to_datetime if we see a dt64 object and a tz-aware datetime, we treat the dt64 as a UTC time. But if we have dt64 objects and are passed a timezone, we treat them as wall times. I'd expect the two DTIs above to match.
Metadata
Metadata
Assignees
Labels
API - ConsistencyInternal Consistency of API/BehaviorInternal Consistency of API/BehaviorBugConstructorsSeries/DataFrame/Index/pd.array ConstructorsSeries/DataFrame/Index/pd.array ConstructorsDatetimeDatetime data dtypeDatetime data dtype