We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dti = pd.date_range("2016-01-01", periods=2) dtype = dti.tz_localize("US/Pacific").dtype dta = dti._data ser = pd.Series(dta) >>> dta.astype(dtype) # matches dti.astype(dtype) <DatetimeArray> ['2016-01-01 00:00:00-08:00', '2016-01-02 00:00:00-08:00'] Length: 2, dtype: datetime64[ns, US/Pacific] >>> ser.astype(dtype)._values <DatetimeArray> ['2015-12-31 16:00:00-08:00', '2016-01-01 16:00:00-08:00'] Length: 2, dtype: datetime64[ns, US/Pacific]
Series.astype behavior is defined in DatetimeBlock.astype, is equivalent to dta.tz_localize("UTC").tz_convert(dtype.tz)
Series.astype
DatetimeBlock.astype
dta.tz_localize("UTC").tz_convert(dtype.tz)
The text was updated successfully, but these errors were encountered:
xref #33401?
Sorry, something went wrong.
Yep, good catch. Let's close as duplicate this evening, hopefully get some more eyeballs on this in the interim
No branches or pull requests
Series.astype
behavior is defined inDatetimeBlock.astype
, is equivalent todta.tz_localize("UTC").tz_convert(dtype.tz)
The text was updated successfully, but these errors were encountered: