<p dir="auto">As pointed out by <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/dsm054/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/dsm054">@dsm054</a>, there are multiple lurking split/partition API requests. Here are the issues and a short summary of what they would do (there are some duplicates here, I've checked off those issues/PRs that have been closed in favor of a related issue):</p>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="2344651" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/414" data-hovercard-type="issue" data-hovercard-url="/pandas-dev/pandas/issues/414/hovercard" href="https://github.com/pandas-dev/pandas/issues/414">#414</a>: (i think) original issue for these ideas going back 3 years</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="3702724" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/936" data-hovercard-type="issue" data-hovercard-url="/pandas-dev/pandas/issues/936/hovercard" href="https://github.com/pandas-dev/pandas/issues/936">#936</a>: windowing with time-length windows like <code class="notranslate">pd.rolling_mean(ts, window='30min')</code> and possibly even arbitrary windows using another column</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="12096079" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/3066" data-hovercard-type="issue" data-hovercard-url="/pandas-dev/pandas/issues/3066/hovercard" href="https://github.com/pandas-dev/pandas/issues/3066">#3066</a>: <code class="notranslate">split</code> method on pandas objects, playing around with ideas</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="12208965" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/3101" data-hovercard-type="pull_request" data-hovercard-url="/pandas-dev/pandas/pull/3101/hovercard" href="https://github.com/pandas-dev/pandas/pull/3101">#3101</a>: a closed PR by <a class="user-mention notranslate" data-hovercard-type="organization" data-hovercard-url="/orgs/y-p/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/y-p">@y-p</a> to use the args of lambda to group a frame into views of a sliding window</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="14636052" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/3685" data-hovercard-type="issue" data-hovercard-url="/pandas-dev/pandas/issues/3685/hovercard" href="https://github.com/pandas-dev/pandas/issues/3685">#3685</a>: resampling using the first <code class="notranslate">n</code> samples of a bin.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="16097994" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/4059" data-hovercard-type="issue" data-hovercard-url="/pandas-dev/pandas/issues/4059/hovercard" href="https://github.com/pandas-dev/pandas/issues/4059">#4059</a>: <code class="notranslate">np.array_split</code> style API where you can split a pandas object into a list of <code class="notranslate">k</code> groups of possibly unequal size (could be a thin wrapper around <code class="notranslate">np.array_split</code>, or more integrated into the pandas DSL). IMO, this issue provides the best starting point for an API. <a href="http://stackoverflow.com/questions/24461906/how-can-i-divide-up-a-pandas-dataframe/24462529#24462529" rel="nofollow">SO usage</a></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="22468657" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/5494" data-hovercard-type="issue" data-hovercard-url="/pandas-dev/pandas/issues/5494/hovercard" href="https://github.com/pandas-dev/pandas/issues/5494">#5494</a>: an API for to allow pandas' <code class="notranslate">groupby</code> to have <code class="notranslate">itertools.groupby</code> semantics (i.e., preserve the order of duplicated group keys), i.e., <code class="notranslate">'aabbaa'</code> would yield groups <code class="notranslate">['aa', 'bb', 'aa']</code> rather than <code class="notranslate">['aaaa', 'bb']</code>. There'd have to be some changes to the use of <code class="notranslate">dict</code> in the groupby backend as noted by <a class="user-mention notranslate" data-hovercard-type="organization" data-hovercard-url="/orgs/y-p/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/y-p">@y-p</a> here <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="16097994" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/4059" data-hovercard-type="issue" data-hovercard-url="/pandas-dev/pandas/issues/4059/hovercard?comment_id=29061036&amp;comment_type=issue_comment" href="https://github.com/pandas-dev/pandas/issues/4059#issuecomment-29061036">#4059 (comment)</a>.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="29855601" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/6675" data-hovercard-type="issue" data-hovercard-url="/pandas-dev/pandas/issues/6675/hovercard" href="https://github.com/pandas-dev/pandas/issues/6675">#6675</a>: Ability to select ranged groups via another column, like "select all rows between the values X and Y from column C", e.g., an "events" column where you have a start and end markers and you want to get the data in between the markers. There are a couple of ways you can do this, but it would be nice to have an API for this. This is very similar to <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="3702724" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/936" data-hovercard-type="issue" data-hovercard-url="/pandas-dev/pandas/issues/936/hovercard" href="https://github.com/pandas-dev/pandas/issues/936">#936</a>.</li>
</ul>
<p dir="auto">The <a href="https://github.com/pytoolz/toolz"><code class="notranslate">toolz</code></a> library has a <code class="notranslate">partitionby</code> function that provides a nice way to do some of the splitting on sequences and might provide us with some insight on how to approach the API.</p>
<p dir="auto">cc <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/jreback/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/jreback">@jreback</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/jorisvandenbossche/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/jorisvandenbossche">@jorisvandenbossche</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/hayd/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/hayd">@hayd</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/danielballan/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/danielballan">@danielballan</a></p>
<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="cols = ['15:00:00', '15:01:00', '15:02:00', '15:02:30']
cols_td = pd.to_timedelta(cols)

df = pd.DataFrame(0, index=range(4), columns=cols_td)

vw1 = df.loc[:, :cols[-2]]
vw2 = df.loc[:, :cols_td[-2]]
print(vw1)
print(vw2)

print('Statement below must be equal')
print(vw1.equals(vw2))"><pre class="notranslate"><span class="pl-s1">cols</span> <span class="pl-c1">=</span> [<span class="pl-s">'15:00:00'</span>, <span class="pl-s">'15:01:00'</span>, <span class="pl-s">'15:02:00'</span>, <span class="pl-s">'15:02:30'</span>]
<span class="pl-s1">cols_td</span> <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-en">to_timedelta</span>(<span class="pl-s1">cols</span>)

<span class="pl-s1">df</span> <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-v">DataFrame</span>(<span class="pl-c1">0</span>, <span class="pl-s1">index</span><span class="pl-c1">=</span><span class="pl-en">range</span>(<span class="pl-c1">4</span>), <span class="pl-s1">columns</span><span class="pl-c1">=</span><span class="pl-s1">cols_td</span>)

<span class="pl-s1">vw1</span> <span class="pl-c1">=</span> <span class="pl-s1">df</span>.<span class="pl-s1">loc</span>[:, :<span class="pl-s1">cols</span>[<span class="pl-c1">-</span><span class="pl-c1">2</span>]]
<span class="pl-s1">vw2</span> <span class="pl-c1">=</span> <span class="pl-s1">df</span>.<span class="pl-s1">loc</span>[:, :<span class="pl-s1">cols_td</span>[<span class="pl-c1">-</span><span class="pl-c1">2</span>]]
<span class="pl-en">print</span>(<span class="pl-s1">vw1</span>)
<span class="pl-en">print</span>(<span class="pl-s1">vw2</span>)

<span class="pl-en">print</span>(<span class="pl-s">'Statement below must be equal'</span>)
<span class="pl-en">print</span>(<span class="pl-s1">vw1</span>.<span class="pl-en">equals</span>(<span class="pl-s1">vw2</span>))</pre></div>
<h4 dir="auto">Problem description</h4>
<p dir="auto">vw1 is wrong. vw2 is correct<br>
Slicing TimdeltaIndex DataFrame with string doesn't seem to work. It doesn't take into account seconds</p>
<h4 dir="auto">Expected Output</h4>
<p dir="auto">Both views must be equal</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.3.final.0<br>
python-bits: 64<br>
OS: Windows<br>
OS-release: 10<br>
machine: AMD64<br>
processor: Intel64 Family 6 Model 79 Stepping 1, GenuineIntel<br>
byteorder: little<br>
LC_ALL: None<br>
LANG: None<br>
LOCALE: None.None</p>
<p dir="auto">pandas: 0.20.3<br>
pytest: 3.2.1<br>
pip: 9.0.1<br>
setuptools: 36.5.0.post20170921<br>
Cython: 0.26.1<br>
numpy: 1.13.3<br>
scipy: 0.19.1<br>
xarray: None<br>
IPython: 6.1.0<br>
sphinx: 1.6.3<br>
patsy: 0.4.1<br>
dateutil: 2.6.1<br>
pytz: 2017.2<br>
blosc: None<br>
bottleneck: 1.2.1<br>
tables: 3.4.2<br>
numexpr: 2.6.2<br>
feather: None<br>
matplotlib: 2.1.0<br>
openpyxl: 2.4.8<br>
xlrd: 1.1.0<br>
xlwt: 1.3.0<br>
xlsxwriter: 1.0.2<br>
lxml: 4.1.0<br>
bs4: 4.6.0<br>
html5lib: 0.999999999<br>
sqlalchemy: 1.1.13<br>
pymysql: None<br>
psycopg2: None<br>
jinja2: 2.9.6<br>
s3fs: None<br>
pandas_gbq: None<br>
pandas_datareader: None</p>
</details>