<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

index = pd.timedelta_range('0', periods=4, freq='s')
series = pd.Series(range(4), index=index)
print series

print series.resample('2s', label='left').sum()

print series.resample('2s', label='right').sum()

print series.resample('2s', label='right', closed='right').sum()"><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">index</span> <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-en">timedelta_range</span>(<span class="pl-s">'0'</span>, <span class="pl-s1">periods</span><span class="pl-c1">=</span><span class="pl-c1">4</span>, <span class="pl-s1">freq</span><span class="pl-c1">=</span><span class="pl-s">'s'</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">range</span>(<span class="pl-c1">4</span>), <span class="pl-s1">index</span><span class="pl-c1">=</span><span class="pl-s1">index</span>)
<span class="pl-k">print</span> <span class="pl-s1">series</span>

<span class="pl-k">print</span> <span class="pl-s1">series</span>.<span class="pl-en">resample</span>(<span class="pl-s">'2s'</span>, <span class="pl-s1">label</span><span class="pl-c1">=</span><span class="pl-s">'left'</span>).<span class="pl-en">sum</span>()

<span class="pl-k">print</span> <span class="pl-s1">series</span>.<span class="pl-en">resample</span>(<span class="pl-s">'2s'</span>, <span class="pl-s1">label</span><span class="pl-c1">=</span><span class="pl-s">'right'</span>).<span class="pl-en">sum</span>()

<span class="pl-k">print</span> <span class="pl-s1">series</span>.<span class="pl-en">resample</span>(<span class="pl-s">'2s'</span>, <span class="pl-s1">label</span><span class="pl-c1">=</span><span class="pl-s">'right'</span>, <span class="pl-s1">closed</span><span class="pl-c1">=</span><span class="pl-s">'right'</span>).<span class="pl-en">sum</span>()</pre></div>
<h4 dir="auto">The output</h4>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="00:00:00    0
00:00:01    1
00:00:02    2
00:00:03    3
Freq: S, dtype: int64
00:00:00    1
00:00:02    5
Freq: 2S, dtype: int64
00:00:00    1
00:00:02    5
Freq: 2S, dtype: int64
00:00:00    1
00:00:02    5
Freq: 2S, dtype: int64"><pre class="notranslate"><code class="notranslate">00:00:00    0
00:00:01    1
00:00:02    2
00:00:03    3
Freq: S, dtype: int64
00:00:00    1
00:00:02    5
Freq: 2S, dtype: int64
00:00:00    1
00:00:02    5
Freq: 2S, dtype: int64
00:00:00    1
00:00:02    5
Freq: 2S, dtype: int64
</code></pre></div>
<h4 dir="auto">Problem description</h4>
<p dir="auto">When calling the function resample with a DatetimeIndex works as expected. However, if called with a TimedeltaIndex the options label and closed does not work.</p>
<h4 dir="auto">Expected Output</h4>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="00:00:00    0
00:00:01    1
00:00:02    2
00:00:03    3
Freq: S, dtype: int64
00:00:00    1
00:00:02    5
Freq: 2S, dtype: int64
00:00:02    1
00:00:04    5
Freq: 2S, dtype: int64
00:00:00    0
00:00:02    3
00:00:04    3
Freq: 2S, dtype: int64"><pre class="notranslate"><code class="notranslate">00:00:00    0
00:00:01    1
00:00:02    2
00:00:03    3
Freq: S, dtype: int64
00:00:00    1
00:00:02    5
Freq: 2S, dtype: int64
00:00:02    1
00:00:04    5
Freq: 2S, dtype: int64
00:00:00    0
00:00:02    3
00:00:04    3
Freq: 2S, dtype: int64
</code></pre></div>
<h4 dir="auto">Output of <code class="notranslate">pd.show_versions()</code></h4>
<details>
# Paste the output here pd.show_versions() here
<h2 dir="auto">INSTALLED VERSIONS</h2>
<p dir="auto">commit: None<br>
python: 2.7.6.final.0<br>
python-bits: 64<br>
OS: Linux<br>
OS-release: 3.19.0-74-generic<br>
machine: x86_64<br>
processor: x86_64<br>
byteorder: little<br>
LC_ALL: None<br>
LANG: en_GB.UTF-8<br>
LOCALE: None.None</p>
<p dir="auto">pandas: 0.19.2<br>
nose: 1.3.1<br>
pip: 9.0.1<br>
setuptools: 28.8.0<br>
Cython: 0.24.1<br>
numpy: 1.12.0<br>
scipy: 0.18.1<br>
statsmodels: 0.5.0<br>
xarray: None<br>
IPython: 4.1.2<br>
sphinx: 1.4.6<br>
patsy: 0.4.1<br>
dateutil: 2.6.0<br>
pytz: 2016.10<br>
blosc: None<br>
bottleneck: None<br>
tables: 3.1.1<br>
numexpr: 2.2.2<br>
matplotlib: 1.5.3<br>
openpyxl: 1.7.0<br>
xlrd: 0.9.2<br>
xlwt: 0.7.5<br>
xlsxwriter: None<br>
lxml: None<br>
bs4: 4.2.1<br>
html5lib: 0.999<br>
httplib2: 0.8<br>
apiclient: None<br>
sqlalchemy: None<br>
pymysql: None<br>
psycopg2: 2.4.5 (dt dec mx pq3 ext)<br>
jinja2: 2.8<br>
boto: None<br>
pandas_datareader: None</p>
</details>
<p dir="auto">brought up in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="149449545" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/12925" data-hovercard-type="issue" data-hovercard-url="/pandas-dev/pandas/issues/12925/hovercard" href="https://github.com/pandas-dev/pandas/issues/12925">#12925</a><br>
some examples in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="201928041" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/15167" data-hovercard-type="issue" data-hovercard-url="/pandas-dev/pandas/issues/15167/hovercard" href="https://github.com/pandas-dev/pandas/issues/15167">#15167</a></p>
<p dir="auto">Resampling fence posts are off when upsampling &lt; 1 Day.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="In [5]: df = DataFrame(data=[[1, 3], [-5, 10], [0, 0]],index=pd.timedelta_range('00:00:00','00:10:00',freq='5T'))

In [6]: df.resample('1T').asfreq()
Out[6]: 
            0     1
00:00:00  1.0   3.0
00:01:00  NaN   NaN
00:02:00  NaN   NaN
00:03:00  NaN   NaN
00:04:00  NaN   NaN
00:05:00 -5.0  10.0
00:06:00  NaN   NaN
00:07:00  NaN   NaN
00:08:00  NaN   NaN
00:09:00  NaN   NaN

In [8]: df.resample('1T').mean()
Out[8]: 
            0     1
00:00:00  1.0   3.0
00:01:00  NaN   NaN
00:02:00  NaN   NaN
00:03:00  NaN   NaN
00:04:00  NaN   NaN
00:05:00 -5.0  10.0
00:06:00  NaN   NaN
00:07:00  NaN   NaN
00:08:00  NaN   NaN
00:09:00  NaN   NaN
00:10:00  0.0   0.0"><pre class="notranslate"><code class="notranslate">In [5]: df = DataFrame(data=[[1, 3], [-5, 10], [0, 0]],index=pd.timedelta_range('00:00:00','00:10:00',freq='5T'))

In [6]: df.resample('1T').asfreq()
Out[6]: 
            0     1
00:00:00  1.0   3.0
00:01:00  NaN   NaN
00:02:00  NaN   NaN
00:03:00  NaN   NaN
00:04:00  NaN   NaN
00:05:00 -5.0  10.0
00:06:00  NaN   NaN
00:07:00  NaN   NaN
00:08:00  NaN   NaN
00:09:00  NaN   NaN

In [8]: df.resample('1T').mean()
Out[8]: 
            0     1
00:00:00  1.0   3.0
00:01:00  NaN   NaN
00:02:00  NaN   NaN
00:03:00  NaN   NaN
00:04:00  NaN   NaN
00:05:00 -5.0  10.0
00:06:00  NaN   NaN
00:07:00  NaN   NaN
00:08:00  NaN   NaN
00:09:00  NaN   NaN
00:10:00  0.0   0.0
</code></pre></div>