Examples
Localize local times:

In [1]:
import numpy as np
import pandas as pd
In [2]:
s = pd.Series([1],
index=pd.DatetimeIndex(['2019-09-15 01:30:00']))
s.tz_localize('CET')
Out[2]:
2019-09-15 01:30:00+02:00    1
dtype: int64

Be careful with DST changes. When there is sequential data, pandas can
infer the DST time:

In [3]:
s = pd.Series(range(7), index=pd.DatetimeIndex([
 '2019-10-28 01:30:00',
 '2019-10-28 02:00:00',
 '2019-10-28 02:30:00',
 '2019-10-28 02:00:00',
 '2019-10-28 02:30:00',
 '2019-10-28 03:00:00',
 '2019-10-28 03:30:00']))
s.tz_localize('CET', ambiguous='infer')
Out[3]:
2019-10-28 01:30:00+01:00    0
2019-10-28 02:00:00+01:00    1
2019-10-28 02:30:00+01:00    2
2019-10-28 02:00:00+01:00    3
2019-10-28 02:30:00+01:00    4
2019-10-28 03:00:00+01:00    5
2019-10-28 03:30:00+01:00    6
dtype: int64

In some cases, inferring the DST is impossible. In such cases, you can pass an ndarray
to the ambiguous parameter to set the DST explicitly

In [4]:
s = pd.Series(range(3), index=pd.DatetimeIndex([
'2019-10-28 01:20:00',
'2019-10-28 02:36:00',
'2019-10-28 03:46:00']))
s.tz_localize('CET', ambiguous=np.array([True, True, False]))
Out[4]:
2019-10-28 01:20:00+01:00    0
2019-10-28 02:36:00+01:00    1
2019-10-28 03:46:00+01:00    2
dtype: int64