Issue 1:
(pandas versions: 0.17.0, 0.18.0)

It seems that Series.replace is orders of magnitude slower than Series.map when called with a dict, and consumes enormous amounts of RAM:

>>> np.random.seed(0)
>>> s = pd.Series(np.random.randint(0, 10000, 1000000))
>>> r = {np.random.randint(0, 10000): np.random.randint(10000) for _ in range(1000)}
>>> assert (s.map(r).fillna(s) == s.replace(r)).all()
>>> %timeit s.replace(r)
1 loop, best of 3: 1.63 s per loop
>>> %timeit s.map(r).fillna(s)
10 loops, best of 3: 26.6 ms per loop

Memory stats not provided here but I've seen it explode (e.g. use 60+ GB RAM).

An old issue, not sure if related: #6697.

Issue 2:
Polish government provides data on power demand with local timestamps. DST switches are unfortunately not accounted for, so some timestamps are duplicated. Thankfully, the differences aren't big to matter in some applications, but it seems the way these timestamps are provided in the file do not work with tz_localize, which seems to be the tool to fix this problem.

Code Sample

from pandas import Series, Timestamp
Series([14603.9, 14559.700000000001, 14239.0, 14371.0, 13914.5, 14427.200000000001, 14300.5, 14267.5, 14162.200000000001, 14148.5, 14028.1, 14083.1, 14122.9], index=[Timestamp('2015-10-25 01:30:00'), Timestamp('2015-10-25 01:45:00'), Timestamp('2015-10-25 02:00:00'), Timestamp('2015-10-25 02:00:00'), Timestamp('2015-10-25 02:15:00'), Timestamp('2015-10-25 02:15:00'), Timestamp('2015-10-25 02:30:00'), Timestamp('2015-10-25 02:30:00'), Timestamp('2015-10-25 02:45:00'), Timestamp('2015-10-25 02:45:00'), Timestamp('2015-10-25 03:00:00'), Timestamp('2015-10-25 03:15:00'), Timestamp('2015-10-25 03:30:00')]).tz_localize('Europe/Warsaw', ambiguous='infer')

Current Output

[…]
pandas/tslib.pyx in pandas.tslib.tz_localize_to_utc (pandas/tslib.c:69085)()
AmbiguousTimeError: There are 4 dst switches when there should only be 1.

Expected Output

Obviously, we don't know what should be the exact result. My understanding of ambiguous='infer' is that at this point, I'm just letting pandas find some timezone assignment that is not totally wrong, because in some applications this will still be better than NaT. For example:

2015-10-25 01:30:00+02:00 14603.9
2015-10-25 01:45:00+02:00 14559.7
2015-10-25 02:00:00+02:00 14239.0
2015-10-25 02:00:00+01:00 14371.0
2015-10-25 02:15:00+02:00 13914.5
2015-10-25 02:15:00+01:00 14427.2
2015-10-25 02:30:00+02:00 14300.5
2015-10-25 02:30:00+01:00 14267.5
2015-10-25 02:45:00+02:00 14162.2
2015-10-25 02:45:00+01:00 14148.5
2015-10-25 03:00:00+01:00 14028.1
2015-10-25 03:15:00+01:00 14083.1
2015-10-25 03:30:00+01:00 14122.9
dtype: float64

output of pd.show_versions()

In [4]: pandas.show_versions()

INSTALLED VERSIONS
------------------
commit: None
python: 2.7.9.final.0
python-bits: 64
OS: Linux
OS-release: 4.6.0-0.bpo.1-amd64
machine: x86_64
processor:
byteorder: little
LC_ALL: None
LANG: en_US.utf8

pandas: 0.18.1
nose: None
pip: 1.5.6
setuptools: 24.0.3
Cython: 0.24.1
numpy: 1.11.1
scipy: 0.17.1
statsmodels: None
xarray: None
IPython: 5.0.0
sphinx: None
patsy: None
dateutil: 2.5.3
pytz: 2016.6.1
blosc: None
bottleneck: None
tables: None
numexpr: None
matplotlib: 1.5.1
openpyxl: None
xlrd: None
xlwt: None
xlsxwriter: None
lxml: None
bs4: None
html5lib: 0.999
httplib2: None
apiclient: None
sqlalchemy: None
pymysql: None
psycopg2: None
jinja2: 2.8
boto: None
pandas_datareader: None