File tree 1 file changed +8
-9
lines changed
1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -5686,6 +5686,14 @@ def astype(
5686
5686
to_numeric : Convert argument to a numeric type.
5687
5687
numpy.ndarray.astype : Cast a numpy array to a specified type.
5688
5688
5689
+ Notes
5690
+ -----
5691
+ .. deprecated:: 1.3.0
5692
+
5693
+ Using ``astype`` to convert from timezone-naive dtype to
5694
+ timezone-aware dtype is deprecated and will raise in a
5695
+ future version. Use :meth:`Series.dt.tz_localize` instead.
5696
+
5689
5697
Examples
5690
5698
--------
5691
5699
Create a DataFrame:
@@ -5761,15 +5769,6 @@ def astype(
5761
5769
1 2020-01-02
5762
5770
2 2020-01-03
5763
5771
dtype: datetime64[ns]
5764
-
5765
- Datetimes are localized to UTC first before
5766
- converting to the specified timezone:
5767
-
5768
- >>> ser_date.astype('datetime64[ns, US/Eastern]')
5769
- 0 2019-12-31 19:00:00-05:00
5770
- 1 2020-01-01 19:00:00-05:00
5771
- 2 2020-01-02 19:00:00-05:00
5772
- dtype: datetime64[ns, US/Eastern]
5773
5772
"""
5774
5773
if is_dict_like (dtype ):
5775
5774
if self .ndim == 1 : # i.e. Series
You can’t perform that action at this time.
0 commit comments