Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Series.__setitem__ with datetime64[ns, tz] dtype raises ValueError when setting a tz-aware timestamps #12862
I'm not able to construct a Series element by element if the elements are timezone localized datetimes. Any workarounds?
Code Sample, a copy-pastable example if possible
# This works x = pd.Series() x['foo'] = pd.to_datetime(42) x['bar'] = pd.to_datetime(666) # This doesn't x = pd.Series() x['foo'] = pd.to_datetime(42).tz_localize('UTC') x['bar'] = pd.to_datetime(666).tz_localize('UTC')
Shouldn't raise errors.