<p dir="auto">related <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="10671788" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/2802" data-hovercard-type="issue" data-hovercard-url="/pandas-dev/pandas/issues/2802/hovercard" href="https://github.com/pandas-dev/pandas/issues/2802">#2802</a></p>
<p dir="auto">It seems that str[1] is significantly slower than <code class="notranslate">.apply(lambda x: x[1])</code></p>
<p dir="auto">See this So answer <a href="http://stackoverflow.com/a/18473330/1240268" rel="nofollow">http://stackoverflow.com/a/18473330/1240268</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="# Your code here
df = data_index[data_index['ntorsions'] == 2]
"><pre class="notranslate"><span class="pl-c"># Your code here</span>
<span class="pl-s1">df</span> <span class="pl-c1">=</span> <span class="pl-s1">data_index</span>[<span class="pl-s1">data_index</span>[<span class="pl-s">'ntorsions'</span>] <span class="pl-c1">==</span> <span class="pl-c1">2</span>]</pre></div>
<h4 dir="auto">Problem description</h4>
<p dir="auto">When slicing a dataframe, the index is not reset by default.  This becomes an issue if you want to output that dataframe, combine that dataframe with other dataframes (good luck with that), or output the dataframe without two index columns.</p>
<p dir="auto">Fixing this will not break code in the wild.</p>
<h4 dir="auto">Expected Output</h4>
<p dir="auto">Index being correct - without the need to manually call reset_index over and over again. This is much more intuitive to end users.</p>
<p dir="auto">-&gt; At end of slice, call reset_index(drop = True) on the returned dataframe or current dataframe if you are slicing in-place.</p>
<h4 dir="auto">Output of <code class="notranslate">pd.show_versions()</code></h4>
<details>
<p dir="auto">loaded rc file /Users/jadolfbr/.matplotlib/matplotlibrc<br>
matplotlib version 1.5.1<br>
verbose.level helpful<br>
interactive is False<br>
platform is darwin</p>
<h2 dir="auto">INSTALLED VERSIONS</h2>
<p dir="auto">commit: None<br>
python: 2.7.10.final.0<br>
python-bits: 64<br>
OS: Darwin<br>
OS-release: 14.5.0<br>
machine: x86_64<br>
processor: i386<br>
byteorder: little<br>
LC_ALL: None<br>
LANG: en_US.UTF-8</p>
<p dir="auto">pandas: 0.18.1<br>
nose: 1.3.7<br>
pip: 9.0.1<br>
setuptools: 20.3.1<br>
Cython: None<br>
numpy: 1.11.1<br>
scipy: 0.13.0b1<br>
statsmodels: 0.6.1<br>
xarray: None<br>
IPython: 4.1.2<br>
sphinx: None<br>
patsy: 0.4.0<br>
dateutil: 2.5.3<br>
pytz: 2016.4<br>
blosc: None<br>
bottleneck: None<br>
tables: None<br>
numexpr: None<br>
matplotlib: 1.5.1<br>
openpyxl: None<br>
xlrd: None<br>
xlwt: None<br>
xlsxwriter: None<br>
lxml: None<br>
bs4: None<br>
html5lib: None<br>
httplib2: None<br>
apiclient: None<br>
sqlalchemy: None<br>
pymysql: None<br>
psycopg2: None<br>
jinja2: 2.8<br>
boto: None<br>
pandas_datareader: None</p>
</details>