<h4 dir="auto">Code Sample, a copy-pastable example if possible</h4>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import datetime
import pandas as pd

series = pd.Series(
    list(range(8760)),
    index=pd.date_range('2018/01/01', periods=8760, freq='H', tz='Europe/Berlin')
)

# trying to drop first day
series = series.drop(
    series.index[series.index &lt; datetime.datetime(year=2018, month=1, day=2)]
)

# yields AmbiguousTimeError 
"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">datetime</span>
<span class="pl-k">import</span> <span class="pl-s1">pandas</span> <span class="pl-k">as</span> <span class="pl-s1">pd</span>

<span class="pl-s1">series</span> <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-v">Series</span>(
    <span class="pl-en">list</span>(<span class="pl-en">range</span>(<span class="pl-c1">8760</span>)),
    <span class="pl-s1">index</span><span class="pl-c1">=</span><span class="pl-s1">pd</span>.<span class="pl-en">date_range</span>(<span class="pl-s">'2018/01/01'</span>, <span class="pl-s1">periods</span><span class="pl-c1">=</span><span class="pl-c1">8760</span>, <span class="pl-s1">freq</span><span class="pl-c1">=</span><span class="pl-s">'H'</span>, <span class="pl-s1">tz</span><span class="pl-c1">=</span><span class="pl-s">'Europe/Berlin'</span>)
)

<span class="pl-c"># trying to drop first day</span>
<span class="pl-s1">series</span> <span class="pl-c1">=</span> <span class="pl-s1">series</span>.<span class="pl-en">drop</span>(
    <span class="pl-s1">series</span>.<span class="pl-s1">index</span>[<span class="pl-s1">series</span>.<span class="pl-s1">index</span> <span class="pl-c1">&lt;</span> <span class="pl-s1">datetime</span>.<span class="pl-en">datetime</span>(<span class="pl-s1">year</span><span class="pl-c1">=</span><span class="pl-c1">2018</span>, <span class="pl-s1">month</span><span class="pl-c1">=</span><span class="pl-c1">1</span>, <span class="pl-s1">day</span><span class="pl-c1">=</span><span class="pl-c1">2</span>)]
)

<span class="pl-c"># yields AmbiguousTimeError </span></pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="File &quot;pandas/_libs/tslib.pyx&quot;, line 3593, in pandas._libs.tslib.tz_localize_to_utc
pytz.exceptions.AmbiguousTimeError: Cannot infer dst time from Timestamp('2018-10-28 02:00:00'), try using the 'ambiguous' argument"><pre class="notranslate"><code class="notranslate">File "pandas/_libs/tslib.pyx", line 3593, in pandas._libs.tslib.tz_localize_to_utc
pytz.exceptions.AmbiguousTimeError: Cannot infer dst time from Timestamp('2018-10-28 02:00:00'), try using the 'ambiguous' argument
</code></pre></div>
<h4 dir="auto">Problem description</h4>
<p dir="auto">I can't use <code class="notranslate">drop</code> on series that have a timezone aware datetime index. For me, it is not understandable why the error displayed above is raised.</p>
<p dir="auto">The workaround I found is:</p>
<ul dir="auto">
<li>find the positions to drop</li>
<li>convert the series to UTC</li>
<li>drop</li>
<li>convert back to original timezone</li>
</ul>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import datetime
import pandas as pd

series = pd.Series(
    list(range(8760)),
    index=pd.date_range('2018/01/01', periods=8760, freq='H', tz='Europe/Berlin')
)

positions_to_drop = series.index &lt; datetime.datetime(year=2018, month=1, day=2)

tz = series.index.tz
series.index = series.index.tz_convert('UTC')
series = series.drop(
    series.index[positions_to_drop]
)
series.index = series.index.tz_convert(tz)"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">datetime</span>
<span class="pl-k">import</span> <span class="pl-s1">pandas</span> <span class="pl-k">as</span> <span class="pl-s1">pd</span>

<span class="pl-s1">series</span> <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-v">Series</span>(
    <span class="pl-en">list</span>(<span class="pl-en">range</span>(<span class="pl-c1">8760</span>)),
    <span class="pl-s1">index</span><span class="pl-c1">=</span><span class="pl-s1">pd</span>.<span class="pl-en">date_range</span>(<span class="pl-s">'2018/01/01'</span>, <span class="pl-s1">periods</span><span class="pl-c1">=</span><span class="pl-c1">8760</span>, <span class="pl-s1">freq</span><span class="pl-c1">=</span><span class="pl-s">'H'</span>, <span class="pl-s1">tz</span><span class="pl-c1">=</span><span class="pl-s">'Europe/Berlin'</span>)
)

<span class="pl-s1">positions_to_drop</span> <span class="pl-c1">=</span> <span class="pl-s1">series</span>.<span class="pl-s1">index</span> <span class="pl-c1">&lt;</span> <span class="pl-s1">datetime</span>.<span class="pl-en">datetime</span>(<span class="pl-s1">year</span><span class="pl-c1">=</span><span class="pl-c1">2018</span>, <span class="pl-s1">month</span><span class="pl-c1">=</span><span class="pl-c1">1</span>, <span class="pl-s1">day</span><span class="pl-c1">=</span><span class="pl-c1">2</span>)

<span class="pl-s1">tz</span> <span class="pl-c1">=</span> <span class="pl-s1">series</span>.<span class="pl-s1">index</span>.<span class="pl-s1">tz</span>
<span class="pl-s1">series</span>.<span class="pl-s1">index</span> <span class="pl-c1">=</span> <span class="pl-s1">series</span>.<span class="pl-s1">index</span>.<span class="pl-en">tz_convert</span>(<span class="pl-s">'UTC'</span>)
<span class="pl-s1">series</span> <span class="pl-c1">=</span> <span class="pl-s1">series</span>.<span class="pl-en">drop</span>(
    <span class="pl-s1">series</span>.<span class="pl-s1">index</span>[<span class="pl-s1">positions_to_drop</span>]
)
<span class="pl-s1">series</span>.<span class="pl-s1">index</span> <span class="pl-c1">=</span> <span class="pl-s1">series</span>.<span class="pl-s1">index</span>.<span class="pl-en">tz_convert</span>(<span class="pl-s1">tz</span>)</pre></div>
<h4 dir="auto">Expected Output</h4>
<p dir="auto">No error. And the result the previous snippet yields.</p>
<h4 dir="auto">Output of <code class="notranslate">pd.show_versions()</code></h4>
<details>
<h2 dir="auto">INSTALLED VERSIONS</h2>
<p dir="auto">commit: None<br>
python: 3.6.4.final.0<br>
python-bits: 64<br>
OS: Darwin<br>
OS-release: 17.4.0<br>
machine: x86_64<br>
processor: i386<br>
byteorder: little<br>
LC_ALL: None<br>
LANG: None<br>
LOCALE: de_DE.UTF-8<br>
pandas: 0.22.0<br>
pytest: 3.4.2<br>
pip: 9.0.1<br>
setuptools: 38.5.2<br>
Cython: None<br>
numpy: 1.14.2<br>
scipy: None<br>
pyarrow: None<br>
xarray: None<br>
IPython: None<br>
sphinx: 1.7.1<br>
patsy: None<br>
dateutil: 2.6.1<br>
pytz: 2018.3<br>
blosc: None<br>
bottleneck: None<br>
tables: None<br>
numexpr: 2.6.4<br>
feather: None<br>
matplotlib: None<br>
openpyxl: None<br>
xlrd: 1.1.0<br>
xlwt: None<br>
xlsxwriter: None<br>
lxml: None<br>
bs4: None<br>
html5lib: None<br>
sqlalchemy: None<br>
pymysql: None<br>
psycopg2: 2.7.4 (dt dec pq3 ext lo64)<br>
jinja2: 2.10<br>
s3fs: None<br>
fastparquet: None<br>
pandas_gbq: None<br>
pandas_datareader: None</p>
</details>
<h4 dir="auto">Code Sample, a copy-pastable example if possible</h4>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import pandas as pd
start = pd.Timestamp('201710290100', tz='Europe/Brussels')
end = pd.Timestamp('201710290300', tz='Europe/Brussels')
index = pd.date_range(start=start, end=end, freq='15min')

index.drop(index[0])

AmbiguousTimeError: Cannot infer dst time from Timestamp('2017-10-29 02:00:00'), try using the 'ambiguous' argument"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">pandas</span> <span class="pl-k">as</span> <span class="pl-s1">pd</span>
<span class="pl-s1">start</span> <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-v">Timestamp</span>(<span class="pl-s">'201710290100'</span>, <span class="pl-s1">tz</span><span class="pl-c1">=</span><span class="pl-s">'Europe/Brussels'</span>)
<span class="pl-s1">end</span> <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-v">Timestamp</span>(<span class="pl-s">'201710290300'</span>, <span class="pl-s1">tz</span><span class="pl-c1">=</span><span class="pl-s">'Europe/Brussels'</span>)
<span class="pl-s1">index</span> <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-en">date_range</span>(<span class="pl-s1">start</span><span class="pl-c1">=</span><span class="pl-s1">start</span>, <span class="pl-s1">end</span><span class="pl-c1">=</span><span class="pl-s1">end</span>, <span class="pl-s1">freq</span><span class="pl-c1">=</span><span class="pl-s">'15min'</span>)

<span class="pl-s1">index</span>.<span class="pl-en">drop</span>(<span class="pl-s1">index</span>[<span class="pl-c1">0</span>])

<span class="pl-v">AmbiguousTimeError</span>: <span class="pl-v">Cannot</span> <span class="pl-s1">infer</span> <span class="pl-s1">dst</span> <span class="pl-s1">time</span> <span class="pl-k">from</span> <span class="pl-v">Timestamp</span>(<span class="pl-s">'2017-10-29 02:00:00'</span>), <span class="pl-k">try</span> <span class="pl-s1">using</span> <span class="pl-s1">the</span> <span class="pl-s">'ambiguous'</span> <span class="pl-s1">argument</span></pre></div>
<h4 dir="auto">Problem description</h4>
<p dir="auto">When dropping from a localized DateTimeIndex, behind the scenes the index is converted to UTC, the drop is performed, and then it is converted back to the original timezone. (This is what I make of the traceback).<br>
This second conversion is ambiguous because the original index contains a DST change.</p>
<h4 dir="auto">Expected Output</h4>
<h4 dir="auto">Output of <code class="notranslate">index.drop(index[0])</code></h4>
<details>
<blockquote>
<p dir="auto">DatetimeIndex(['2017-10-29 01:15:00+02:00', '2017-10-29 01:30:00+02:00',<br>
'2017-10-29 01:45:00+02:00', '2017-10-29 02:00:00+02:00',<br>
'2017-10-29 02:15:00+02:00', '2017-10-29 02:30:00+02:00',<br>
'2017-10-29 02:45:00+02:00', '2017-10-29 02:00:00+01:00',<br>
'2017-10-29 02:15:00+01:00', '2017-10-29 02:30:00+01:00',<br>
'2017-10-29 02:45:00+01:00', '2017-10-29 03:00:00+01:00'],<br>
dtype='datetime64[ns, Europe/Brussels]', freq='15T')</p>
</blockquote>
</details>