Skip to content

Commit f8a924b

Browse files
wholmgrenTomAugspurger
authored andcommitted
DOC: fix DatetimeIndex.tz_localize doc string example (pandas-dev#28237)
1 parent bfdbebe commit f8a924b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

pandas/core/arrays/datetimes.py

+2
Original file line numberDiff line numberDiff line change
@@ -1063,6 +1063,7 @@ def tz_localize(self, tz, ambiguous="raise", nonexistent="raise", errors=None):
10631063
10641064
Be careful with DST changes. When there is sequential data, pandas can
10651065
infer the DST time:
1066+
10661067
>>> s = pd.to_datetime(pd.Series(['2018-10-28 01:30:00',
10671068
... '2018-10-28 02:00:00',
10681069
... '2018-10-28 02:30:00',
@@ -1094,6 +1095,7 @@ def tz_localize(self, tz, ambiguous="raise", nonexistent="raise", errors=None):
10941095
If the DST transition causes nonexistent times, you can shift these
10951096
dates forward or backwards with a timedelta object or `'shift_forward'`
10961097
or `'shift_backwards'`.
1098+
10971099
>>> s = pd.to_datetime(pd.Series(['2015-03-29 02:30:00',
10981100
... '2015-03-29 03:30:00']))
10991101
>>> s.dt.tz_localize('Europe/Warsaw', nonexistent='shift_forward')

0 commit comments

Comments
 (0)