Pandas version checks
- [X] I have checked that the issue still exists on the latest versions of the docs on
main
here
Location of the documentation
https://pandas.pydata.org/docs/reference/api/pandas.Series.dt.tz_convert.html
Documentation problem
The "See also" would be more useful if it refers to the same type. While the mentioned page is about Series, the "See also" refers to DatetimeIndex.
I was looking to remove timezone information from a tz-aware Datetime Array without converting to UTC. I landed on the linked documentation page (which includes converting to UTC). The "See also" made me aware of the function tz_convert
. Assuming the page was still about a Pandas series, I applied the suggest approach, but ran into an error with my_series.tz_localize(None)
. For Pandas Series, it has to be my_series.dt.tz_localize(None)
(with .dt.
).
Suggested fix for documentation
pandas.Series.dt.tz_convert
"See also" box should refer to:
- pandas.Series.dt.tz
and
- pandas.Series.dt.tz_localize
Rather than the current:
DatetimeIndex.tz - A timezone that has a variable offset from UTC.
DatetimeIndex.tz_localize - Localize tz-naive DatetimeIndex to a given time zone, or remove timezone from a tz-aware DatetimeIndex.
Comment From: wheatonaaron
take