<p dir="auto">Using pandas 0.14, the slicing changed strangely.  I can slice rows using start/end with an integer index, but not a float index:</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="In [18]: df = pandas.DataFrame(np.random.randn(10, 5), index=np.arange(10, 20))

In [19]: df
Out[19]: 
           0         1         2         3         4
10 -1.878123 -0.581537  0.189536  0.173014  0.132059
11  1.229246 -0.988689  0.632404  0.939126 -0.186367
12  0.376735  0.329723  1.480293 -0.209164  0.080897
13  0.461558  0.303541 -0.669196 -1.032077  1.634512
14 -0.972455  0.657357 -0.566609  0.154165 -0.561543
15 -2.502244  1.022540 -1.019376 -0.934582  1.751852
16 -1.875567  0.504288 -0.524922  0.048277 -1.587904
17  0.636652  0.441224 -1.391552  0.650876  0.374673
18 -1.503102  0.822411  1.776667 -0.879583  1.035291
19 -0.620467  0.319855 -0.779280 -0.168827  0.502470

In [20]: df[3:5]
Out[20]: 
           0         1         2         3         4
13  0.461558  0.303541 -0.669196 -1.032077  1.634512
14 -0.972455  0.657357 -0.566609  0.154165 -0.561543

In [21]: df.index = [float(x) for x in df.index]

In [22]: df
Out[22]: 
           0         1         2         3         4
10 -1.878123 -0.581537  0.189536  0.173014  0.132059
11  1.229246 -0.988689  0.632404  0.939126 -0.186367
12  0.376735  0.329723  1.480293 -0.209164  0.080897
13  0.461558  0.303541 -0.669196 -1.032077  1.634512
14 -0.972455  0.657357 -0.566609  0.154165 -0.561543
15 -2.502244  1.022540 -1.019376 -0.934582  1.751852
16 -1.875567  0.504288 -0.524922  0.048277 -1.587904
17  0.636652  0.441224 -1.391552  0.650876  0.374673
18 -1.503102  0.822411  1.776667 -0.879583  1.035291
19 -0.620467  0.319855 -0.779280 -0.168827  0.502470

In [23]: df[3:5]
Out[23]: 
Empty DataFrame
Columns: [0, 1, 2, 3, 4]
Index: []

In [24]: df.index
Out[24]: Float64Index([10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0], dtype='float64')

In [25]: pandas.__version__
Out[25]: '0.14.0'"><pre class="notranslate"><span class="pl-v">In</span> [<span class="pl-c1">18</span>]: <span class="pl-s1">df</span> <span class="pl-c1">=</span> <span class="pl-s1">pandas</span>.<span class="pl-v">DataFrame</span>(<span class="pl-s1">np</span>.<span class="pl-s1">random</span>.<span class="pl-en">randn</span>(<span class="pl-c1">10</span>, <span class="pl-c1">5</span>), <span class="pl-s1">index</span><span class="pl-c1">=</span><span class="pl-s1">np</span>.<span class="pl-en">arange</span>(<span class="pl-c1">10</span>, <span class="pl-c1">20</span>))

<span class="pl-v">In</span> [<span class="pl-c1">19</span>]: <span class="pl-s1">df</span>
<span class="pl-v">Out</span>[<span class="pl-c1">19</span>]: 
           <span class="pl-c1">0</span>         <span class="pl-c1">1</span>         <span class="pl-c1">2</span>         <span class="pl-c1">3</span>         <span class="pl-c1">4</span>
<span class="pl-c1">10</span> <span class="pl-c1">-</span><span class="pl-c1">1.878123</span> <span class="pl-c1">-</span><span class="pl-c1">0.581537</span>  <span class="pl-c1">0.189536</span>  <span class="pl-c1">0.173014</span>  <span class="pl-c1">0.132059</span>
<span class="pl-c1">11</span>  <span class="pl-c1">1.229246</span> <span class="pl-c1">-</span><span class="pl-c1">0.988689</span>  <span class="pl-c1">0.632404</span>  <span class="pl-c1">0.939126</span> <span class="pl-c1">-</span><span class="pl-c1">0.186367</span>
<span class="pl-c1">12</span>  <span class="pl-c1">0.376735</span>  <span class="pl-c1">0.329723</span>  <span class="pl-c1">1.480293</span> <span class="pl-c1">-</span><span class="pl-c1">0.209164</span>  <span class="pl-c1">0.080897</span>
<span class="pl-c1">13</span>  <span class="pl-c1">0.461558</span>  <span class="pl-c1">0.303541</span> <span class="pl-c1">-</span><span class="pl-c1">0.669196</span> <span class="pl-c1">-</span><span class="pl-c1">1.032077</span>  <span class="pl-c1">1.634512</span>
<span class="pl-c1">14</span> <span class="pl-c1">-</span><span class="pl-c1">0.972455</span>  <span class="pl-c1">0.657357</span> <span class="pl-c1">-</span><span class="pl-c1">0.566609</span>  <span class="pl-c1">0.154165</span> <span class="pl-c1">-</span><span class="pl-c1">0.561543</span>
<span class="pl-c1">15</span> <span class="pl-c1">-</span><span class="pl-c1">2.502244</span>  <span class="pl-c1">1.022540</span> <span class="pl-c1">-</span><span class="pl-c1">1.019376</span> <span class="pl-c1">-</span><span class="pl-c1">0.934582</span>  <span class="pl-c1">1.751852</span>
<span class="pl-c1">16</span> <span class="pl-c1">-</span><span class="pl-c1">1.875567</span>  <span class="pl-c1">0.504288</span> <span class="pl-c1">-</span><span class="pl-c1">0.524922</span>  <span class="pl-c1">0.048277</span> <span class="pl-c1">-</span><span class="pl-c1">1.587904</span>
<span class="pl-c1">17</span>  <span class="pl-c1">0.636652</span>  <span class="pl-c1">0.441224</span> <span class="pl-c1">-</span><span class="pl-c1">1.391552</span>  <span class="pl-c1">0.650876</span>  <span class="pl-c1">0.374673</span>
<span class="pl-c1">18</span> <span class="pl-c1">-</span><span class="pl-c1">1.503102</span>  <span class="pl-c1">0.822411</span>  <span class="pl-c1">1.776667</span> <span class="pl-c1">-</span><span class="pl-c1">0.879583</span>  <span class="pl-c1">1.035291</span>
<span class="pl-c1">19</span> <span class="pl-c1">-</span><span class="pl-c1">0.620467</span>  <span class="pl-c1">0.319855</span> <span class="pl-c1">-</span><span class="pl-c1">0.779280</span> <span class="pl-c1">-</span><span class="pl-c1">0.168827</span>  <span class="pl-c1">0.502470</span>

<span class="pl-v">In</span> [<span class="pl-c1">20</span>]: <span class="pl-s1">df</span>[<span class="pl-c1">3</span>:<span class="pl-c1">5</span>]
<span class="pl-v">Out</span>[<span class="pl-c1">20</span>]: 
           <span class="pl-c1">0</span>         <span class="pl-c1">1</span>         <span class="pl-c1">2</span>         <span class="pl-c1">3</span>         <span class="pl-c1">4</span>
<span class="pl-c1">13</span>  <span class="pl-c1">0.461558</span>  <span class="pl-c1">0.303541</span> <span class="pl-c1">-</span><span class="pl-c1">0.669196</span> <span class="pl-c1">-</span><span class="pl-c1">1.032077</span>  <span class="pl-c1">1.634512</span>
<span class="pl-c1">14</span> <span class="pl-c1">-</span><span class="pl-c1">0.972455</span>  <span class="pl-c1">0.657357</span> <span class="pl-c1">-</span><span class="pl-c1">0.566609</span>  <span class="pl-c1">0.154165</span> <span class="pl-c1">-</span><span class="pl-c1">0.561543</span>

<span class="pl-v">In</span> [<span class="pl-c1">21</span>]: <span class="pl-s1">df</span>.<span class="pl-s1">index</span> <span class="pl-c1">=</span> [<span class="pl-en">float</span>(<span class="pl-s1">x</span>) <span class="pl-k">for</span> <span class="pl-s1">x</span> <span class="pl-c1">in</span> <span class="pl-s1">df</span>.<span class="pl-s1">index</span>]

<span class="pl-v">In</span> [<span class="pl-c1">22</span>]: <span class="pl-s1">df</span>
<span class="pl-v">Out</span>[<span class="pl-c1">22</span>]: 
           <span class="pl-c1">0</span>         <span class="pl-c1">1</span>         <span class="pl-c1">2</span>         <span class="pl-c1">3</span>         <span class="pl-c1">4</span>
<span class="pl-c1">10</span> <span class="pl-c1">-</span><span class="pl-c1">1.878123</span> <span class="pl-c1">-</span><span class="pl-c1">0.581537</span>  <span class="pl-c1">0.189536</span>  <span class="pl-c1">0.173014</span>  <span class="pl-c1">0.132059</span>
<span class="pl-c1">11</span>  <span class="pl-c1">1.229246</span> <span class="pl-c1">-</span><span class="pl-c1">0.988689</span>  <span class="pl-c1">0.632404</span>  <span class="pl-c1">0.939126</span> <span class="pl-c1">-</span><span class="pl-c1">0.186367</span>
<span class="pl-c1">12</span>  <span class="pl-c1">0.376735</span>  <span class="pl-c1">0.329723</span>  <span class="pl-c1">1.480293</span> <span class="pl-c1">-</span><span class="pl-c1">0.209164</span>  <span class="pl-c1">0.080897</span>
<span class="pl-c1">13</span>  <span class="pl-c1">0.461558</span>  <span class="pl-c1">0.303541</span> <span class="pl-c1">-</span><span class="pl-c1">0.669196</span> <span class="pl-c1">-</span><span class="pl-c1">1.032077</span>  <span class="pl-c1">1.634512</span>
<span class="pl-c1">14</span> <span class="pl-c1">-</span><span class="pl-c1">0.972455</span>  <span class="pl-c1">0.657357</span> <span class="pl-c1">-</span><span class="pl-c1">0.566609</span>  <span class="pl-c1">0.154165</span> <span class="pl-c1">-</span><span class="pl-c1">0.561543</span>
<span class="pl-c1">15</span> <span class="pl-c1">-</span><span class="pl-c1">2.502244</span>  <span class="pl-c1">1.022540</span> <span class="pl-c1">-</span><span class="pl-c1">1.019376</span> <span class="pl-c1">-</span><span class="pl-c1">0.934582</span>  <span class="pl-c1">1.751852</span>
<span class="pl-c1">16</span> <span class="pl-c1">-</span><span class="pl-c1">1.875567</span>  <span class="pl-c1">0.504288</span> <span class="pl-c1">-</span><span class="pl-c1">0.524922</span>  <span class="pl-c1">0.048277</span> <span class="pl-c1">-</span><span class="pl-c1">1.587904</span>
<span class="pl-c1">17</span>  <span class="pl-c1">0.636652</span>  <span class="pl-c1">0.441224</span> <span class="pl-c1">-</span><span class="pl-c1">1.391552</span>  <span class="pl-c1">0.650876</span>  <span class="pl-c1">0.374673</span>
<span class="pl-c1">18</span> <span class="pl-c1">-</span><span class="pl-c1">1.503102</span>  <span class="pl-c1">0.822411</span>  <span class="pl-c1">1.776667</span> <span class="pl-c1">-</span><span class="pl-c1">0.879583</span>  <span class="pl-c1">1.035291</span>
<span class="pl-c1">19</span> <span class="pl-c1">-</span><span class="pl-c1">0.620467</span>  <span class="pl-c1">0.319855</span> <span class="pl-c1">-</span><span class="pl-c1">0.779280</span> <span class="pl-c1">-</span><span class="pl-c1">0.168827</span>  <span class="pl-c1">0.502470</span>

<span class="pl-v">In</span> [<span class="pl-c1">23</span>]: <span class="pl-s1">df</span>[<span class="pl-c1">3</span>:<span class="pl-c1">5</span>]
<span class="pl-v">Out</span>[<span class="pl-c1">23</span>]: 
<span class="pl-v">Empty</span> <span class="pl-v">DataFrame</span>
<span class="pl-v">Columns</span>: [<span class="pl-c1">0</span>, <span class="pl-c1">1</span>, <span class="pl-c1">2</span>, <span class="pl-c1">3</span>, <span class="pl-c1">4</span>]
<span class="pl-v">Index</span>: []

<span class="pl-v">In</span> [<span class="pl-c1">24</span>]: <span class="pl-s1">df</span>.<span class="pl-s1">index</span>
<span class="pl-v">Out</span>[<span class="pl-c1">24</span>]: <span class="pl-v">Float64Index</span>([<span class="pl-c1">10.0</span>, <span class="pl-c1">11.0</span>, <span class="pl-c1">12.0</span>, <span class="pl-c1">13.0</span>, <span class="pl-c1">14.0</span>, <span class="pl-c1">15.0</span>, <span class="pl-c1">16.0</span>, <span class="pl-c1">17.0</span>, <span class="pl-c1">18.0</span>, <span class="pl-c1">19.0</span>], <span class="pl-s1">dtype</span><span class="pl-c1">=</span><span class="pl-s">'float64'</span>)

<span class="pl-v">In</span> [<span class="pl-c1">25</span>]: <span class="pl-s1">pandas</span>.<span class="pl-s1">__version__</span>
<span class="pl-v">Out</span>[<span class="pl-c1">25</span>]: <span class="pl-s">'0.14.0'</span></pre></div>
<p dir="auto">Was this an intentional change, or a bug?</p>
<p dir="auto">I was implementing some new objects for another PR and noticed that string methods are duplicated throughout (particularly on objects that don't inherit from each other).  Wrote this up on this branch - <a href="https://github.com/jtratner/pandas/tree/refactor_string_magic_methods">https://github.com/jtratner/pandas/tree/refactor_string_magic_methods</a> .</p>
<p dir="auto">If you thing this is worthwhile, I'll split it up a little, add a bit better documentation and submit.</p>
<p dir="auto">This is used multiple times:</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="    def __str__(self):
        &quot;&quot;&quot;
        Return a string representation for a particular object.

        Invoked by str(obj) in both py2/py3.
        Yields Bytestring in Py2, Unicode String in py3.
        &quot;&quot;&quot;

        if py3compat.PY3:
            return self.__unicode__()
        return self.__bytes__()

    def __bytes__(self):
        &quot;&quot;&quot;
        Return a string representation for a particular object.

        Invoked by bytes(obj) in py3 only.
        Yields a bytestring in both py2/py3.
        &quot;&quot;&quot;
        from pandas.core.config import get_option

        encoding = get_option(&quot;display.encoding&quot;)
        return self.__unicode__().encode(encoding, 'replace')

    def __repr__(self):
        &quot;&quot;&quot;
        Return a string representation for a particular object.

        Yields Bytestring in Py2, Unicode String in py3.
        &quot;&quot;&quot;
        return str(self)"><pre class="notranslate">    <span class="pl-k">def</span> <span class="pl-en">__str__</span>(<span class="pl-s1">self</span>):
        <span class="pl-s">"""</span>
<span class="pl-s">        Return a string representation for a particular object.</span>
<span class="pl-s"></span>
<span class="pl-s">        Invoked by str(obj) in both py2/py3.</span>
<span class="pl-s">        Yields Bytestring in Py2, Unicode String in py3.</span>
<span class="pl-s">        """</span>

        <span class="pl-k">if</span> <span class="pl-s1">py3compat</span>.<span class="pl-v">PY3</span>:
            <span class="pl-k">return</span> <span class="pl-s1">self</span>.<span class="pl-en">__unicode__</span>()
        <span class="pl-k">return</span> <span class="pl-s1">self</span>.<span class="pl-en">__bytes__</span>()

    <span class="pl-k">def</span> <span class="pl-en">__bytes__</span>(<span class="pl-s1">self</span>):
        <span class="pl-s">"""</span>
<span class="pl-s">        Return a string representation for a particular object.</span>
<span class="pl-s"></span>
<span class="pl-s">        Invoked by bytes(obj) in py3 only.</span>
<span class="pl-s">        Yields a bytestring in both py2/py3.</span>
<span class="pl-s">        """</span>
        <span class="pl-k">from</span> <span class="pl-s1">pandas</span>.<span class="pl-s1">core</span>.<span class="pl-s1">config</span> <span class="pl-k">import</span> <span class="pl-s1">get_option</span>

        <span class="pl-s1">encoding</span> <span class="pl-c1">=</span> <span class="pl-en">get_option</span>(<span class="pl-s">"display.encoding"</span>)
        <span class="pl-k">return</span> <span class="pl-s1">self</span>.<span class="pl-en">__unicode__</span>().<span class="pl-en">encode</span>(<span class="pl-s1">encoding</span>, <span class="pl-s">'replace'</span>)

    <span class="pl-k">def</span> <span class="pl-en">__repr__</span>(<span class="pl-s1">self</span>):
        <span class="pl-s">"""</span>
<span class="pl-s">        Return a string representation for a particular object.</span>
<span class="pl-s"></span>
<span class="pl-s">        Yields Bytestring in Py2, Unicode String in py3.</span>
<span class="pl-s">        """</span>
        <span class="pl-k">return</span> <span class="pl-en">str</span>(<span class="pl-s1">self</span>)</pre></div>
<p dir="auto">Unicode tends to vary, but often is like this:</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="    def __unicode__(self):
        &quot;&quot;&quot;
        Return a string representation for a particular object.

        Invoked by unicode(obj) in py2 only. Yields a Unicode String in both
        py2/py3.
        &quot;&quot;&quot;
        prepr = pprint_thing(self, escape_chars=('\t', '\r', '\n'), quote_strings=True)
        return '%s(%s)' % (type(self).__name__, prepr)"><pre class="notranslate">    <span class="pl-k">def</span> <span class="pl-en">__unicode__</span>(<span class="pl-s1">self</span>):
        <span class="pl-s">"""</span>
<span class="pl-s">        Return a string representation for a particular object.</span>
<span class="pl-s"></span>
<span class="pl-s">        Invoked by unicode(obj) in py2 only. Yields a Unicode String in both</span>
<span class="pl-s">        py2/py3.</span>
<span class="pl-s">        """</span>
        <span class="pl-s1">prepr</span> <span class="pl-c1">=</span> <span class="pl-en">pprint_thing</span>(<span class="pl-s1">self</span>, <span class="pl-s1">escape_chars</span><span class="pl-c1">=</span>(<span class="pl-s">'<span class="pl-cce">\t</span>'</span>, <span class="pl-s">'<span class="pl-cce">\r</span>'</span>, <span class="pl-s">'<span class="pl-cce">\n</span>'</span>), <span class="pl-s1">quote_strings</span><span class="pl-c1">=</span><span class="pl-c1">True</span>)
        <span class="pl-k">return</span> <span class="pl-s">'%s(%s)'</span> <span class="pl-c1">%</span> (<span class="pl-en">type</span>(<span class="pl-s1">self</span>).<span class="pl-s1">__name__</span>, <span class="pl-s1">prepr</span>)</pre></div>
<p dir="auto">Additionally, a number of objects aren't using a unicode-safe representation of themselves, so this would resolve that as well. Would this be useful to include?</p>