Skip to content

Commit 5e7b205

Browse files
committed
Final Updated Docstring
1 parent fba3685 commit 5e7b205

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

pandas/core/indexes/datetimes.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1939,7 +1939,7 @@ def tz_localize(self, tz, ambiguous='raise', errors='raise'):
19391939
"""
19401940
Convert aware Datetime index to TimeZone naive Datetime index.
19411941
1942-
Localize timezone-naive DatetimeIndex to given time zone,
1942+
Localize timezone-naive DatetimeIndex to given time zone,
19431943
or remove timezone from timezone aware DatetimeIndex.
19441944
19451945
Parameters
@@ -1973,18 +1973,18 @@ def tz_localize(self, tz, ambiguous='raise', errors='raise'):
19731973
19741974
Examples
19751975
--------
1976-
In the example below, We put the date range from 01 March 2018 to 08 March 2018 & convert this to US/Eastern Time zone
1977-
1978-
>>> df = pd.date_range('2018-03-01', '2018-03-08')
1979-
>>> df
1980-
DatetimeIndex(['2018-03-01', '2018-03-02', '2018-03-03', '2018-03-04',
1981-
'2018-03-05', '2018-03-06', '2018-03-07', '2018-03-08'],
1976+
In the example below, We put the date range from 01 March 2018
1977+
to 08 March 2018 & convert this to US/Eastern Time zone
1978+
1979+
>>> df = pd.date_range('2018-03-01', '2018-03-05')
1980+
>>> df
1981+
DatetimeIndex(['2018-03-01', '2018-03-02', '2018-03-03', '2018-03-04',
1982+
'2018-03-05'],
19821983
dtype='datetime64[ns]', freq='D')
1983-
>>> df.tz_localize(tz='US/Eastern')
1984-
DatetimeIndex(['2018-03-01 00:00:00-05:00', '2018-03-02 00:00:00-05:00',
1985-
'2018-03-03 00:00:00-05:00', '2018-03-04 00:00:00-05:00',
1986-
'2018-03-05 00:00:00-05:00', '2018-03-06 00:00:00-05:00',
1987-
'2018-03-07 00:00:00-05:00', '2018-03-08 00:00:00-05:00'],
1984+
>>> df.tz_localize(tz='US/Eastern')
1985+
DatetimeIndex(['2018-03-01 00:00:00-05:00',
1986+
'2018-03-02 00:00:00-05:00', '2018-03-03 00:00:00-05:00',
1987+
'2018-03-04 00:00:00-05:00', '2018-03-05 00:00:00-05:00'],
19881988
dtype='datetime64[ns, US/Eastern]', freq='D')
19891989
19901990
Raises

0 commit comments

Comments
 (0)