-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Closed
Labels
Milestone
Description
Note: This behaviour might be a bug. I'm assuming its an undocumented feature.
Location of the documentation
Documentation problem
to_datetime
outputs different types depending on if the timezones are mixed or not (assuming utc=True
not passed in).
MIXED = ["2018-10-26 12:00 -0500", "2018-10-26 12:00 -0400"]
UNMIXED = ["2018-10-26 12:00 -0500", "2018-10-26 12:00 -0500"]
print(pandas.to_datetime(MIXED).dtype) # ==> object
print(pandas.to_datetime(UNMIXED).dtype) # ==> datetime64[ns, pytz.FixedOffset(-300)]
Suggested fix for documentation
Specify aforementioned behaviour in documentation (in the returns
section). Or, if not intentional feature, update the API to be type-stable.