<p dir="auto"><code class="notranslate">t = pd.DataFrame(np.random.uniform(0,1,[100,100]),index=np.random.uniform(0,1,100)).rolling(10).apply(lambda x: </code>x.argmax()).tail()``<br>
The above code shows only integer values.  However, the index defined is solely in floats (no integers).</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="      0    1    2    3    4    5    6    7    8    9  ..."><pre class="notranslate"><code class="notranslate">      0    1    2    3    4    5    6    7    8    9  ...
</code></pre></div>
<p dir="auto">0.886683  1.0  4.0  1.0  7.0  3.0  6.0  2.0  7.0  5.0  4.0 ...<br>
0.932133  9.0  3.0  0.0  6.0  2.0  9.0  1.0  6.0  4.0  3.0 ...<br>
0.555330  8.0  2.0  4.0  5.0  9.0  8.0  0.0  5.0  3.0  2.0 ...<br>
0.369954  7.0  1.0  3.0  4.0  8.0  7.0  5.0  4.0  2.0  1.0 ...<br>
0.793682  6.0  0.0  2.0  3.0  7.0  9.0  4.0  3.0  1.0  0.0 ...</p>
<p dir="auto">The reason here is that what gets passed into the rolling data frame is a ndarray and not a data frame so access to the index isn't possible.  This limits the rolling function's usefulness especially when dealing with time series data where the index can matter a lot.</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 158 Stepping 9, GenuineIntel<br>
byteorder: little<br>
LC_ALL: None<br>
LANG: en<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.9999999<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>
<p dir="auto">Returning a Series: <a href="http://stackoverflow.com/questions/19121854/using-rolling-apply-on-a-dataframe-object" rel="nofollow">http://stackoverflow.com/questions/19121854/using-rolling-apply-on-a-dataframe-object</a></p>
<p dir="auto">Returning a Scalar: <a href="http://stackoverflow.com/questions/21040766/python-pandas-rolling-apply-two-column-input-into-function/21045831#21045831" rel="nofollow">http://stackoverflow.com/questions/21040766/python-pandas-rolling-apply-two-column-input-into-function/21045831#21045831</a></p>