@@ -1937,18 +1937,18 @@ def tz_convert(self, tz):
1937
1937
mapping = {True : 'infer' , False : 'raise' })
1938
1938
def tz_localize (self , tz , ambiguous = 'raise' , errors = 'raise' ):
1939
1939
"""
1940
- DatetimeIndex.tz_localize used for Localize tz-naive DatetimeIndex.
1941
-
1942
- tz_localize method is use to convert naive DatetimeIndex into any other localize
1943
- DatetimeIndex
1940
+ DatetimeIndex.tz_localize used for Localize tz-naive DatetimeIndex.
1941
+
1942
+ tz_localize method is use to convert naive DatetimeIndex into any other
1943
+ localize DatetimeIndex
1944
1944
1945
1945
1946
1946
Parameters
1947
1947
----------
1948
1948
tz : string, pytz.timezone, dateutil.tz.tzfile or None
1949
1949
Time zone for time. Corresponding timestamps would be converted to
1950
1950
time zone of the TimeSeries.
1951
- None will remove timezone holding local time
1951
+ None will remove timezone holding local time.
1952
1952
ambiguous : 'infer', bool-ndarray, 'NaT', default 'raise'
1953
1953
- 'infer' will attempt to infer fall dst-transition hours based on
1954
1954
order
@@ -1974,10 +1974,9 @@ def tz_localize(self, tz, ambiguous='raise', errors='raise'):
1974
1974
1975
1975
Examples
1976
1976
--------
1977
- In the example below, We put the date range from 01 March 2018 to 08 March 2018
1978
- & convert this to US/Eastern Time zone
1977
+ In the example below, We put the date range from 01 March 2018 to
1978
+ 08 March 2018 & convert this to US/Eastern Time zone
1979
1979
1980
- >>> import pandas as pd
1981
1980
>>> df = pd.date_range('2018-03-01', '2018-03-08')
1982
1981
>>> df
1983
1982
DatetimeIndex(['2018-03-01', '2018-03-02', '2018-03-03', '2018-03-04',
@@ -1993,7 +1992,7 @@ def tz_localize(self, tz, ambiguous='raise', errors='raise'):
1993
1992
Raises
1994
1993
------
1995
1994
TypeError
1996
- If the DatetimeIndex is tz-aware and tz is not None
1995
+ If the DatetimeIndex is tz-aware and tz is not None.
1997
1996
"""
1998
1997
if self .tz is not None :
1999
1998
if tz is None :
0 commit comments