Skip to content

Commit aca527e

Browse files
committed
added infer_dst
1 parent 5e7b205 commit aca527e

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

pandas/core/indexes/datetimes.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1937,7 +1937,7 @@ def tz_convert(self, tz):
19371937
mapping={True: 'infer', False: 'raise'})
19381938
def tz_localize(self, tz, ambiguous='raise', errors='raise'):
19391939
"""
1940-
Convert aware Datetime index to TimeZone naive Datetime index.
1940+
Convert aware to naive.
19411941
19421942
Localize timezone-naive DatetimeIndex to given time zone,
19431943
or remove timezone from timezone aware DatetimeIndex.
@@ -1966,6 +1966,10 @@ def tz_localize(self, tz, ambiguous='raise', errors='raise'):
19661966
19671967
.. versionadded:: 0.19.0
19681968
1969+
infer_dst : boolean, default False
1970+
.. deprecated:: 0.15.0
1971+
Attempt to infer fall dst-transition hours based on order
1972+
19691973
19701974
Returns
19711975
-------
@@ -1978,14 +1982,14 @@ def tz_localize(self, tz, ambiguous='raise', errors='raise'):
19781982
19791983
>>> df = pd.date_range('2018-03-01', '2018-03-05')
19801984
>>> df
1981-
DatetimeIndex(['2018-03-01', '2018-03-02', '2018-03-03', '2018-03-04',
1982-
'2018-03-05'],
1983-
dtype='datetime64[ns]', freq='D')
1985+
DatetimeIndex(['2018-03-01', '2018-03-02', '2018-03-03',
1986+
'2018-03-04', '2018-03-05'],
1987+
dtype='datetime64[ns]', freq='D')
19841988
>>> df.tz_localize(tz='US/Eastern')
19851989
DatetimeIndex(['2018-03-01 00:00:00-05:00',
19861990
'2018-03-02 00:00:00-05:00', '2018-03-03 00:00:00-05:00',
19871991
'2018-03-04 00:00:00-05:00', '2018-03-05 00:00:00-05:00'],
1988-
dtype='datetime64[ns, US/Eastern]', freq='D')
1992+
dtype='datetime64[ns, US/Eastern]', freq='D')
19891993
19901994
Raises
19911995
------

0 commit comments

Comments
 (0)