<p dir="auto">Since irow translates the integer index to a label one and then retrieves the row, in case of duplicate index multiple rows are returned.</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="In [34]: df = pandas.DataFrame(np.random.rand(3,3), columns=list('ABC'), index=list('aab'))

In [35]: df
Out[35]:
          A         B         C
a  0.031057  0.528825  0.694592
a  0.705572  0.122005  0.754107
b  0.475423  0.048636  0.224495

In [36]: df.irow(0)
Out[36]:
          A         B         C
a  0.031057  0.528825  0.694592
a  0.705572  0.122005  0.754107

In [37]: df.irow(1)
Out[37]:
          A         B         C
a  0.031057  0.528825  0.694592
a  0.705572  0.122005  0.754107

In [38]: df.irow(2)
Out[38]:
A    0.475423
B    0.048636
C    0.224495
Name: b
"><pre class="notranslate"><span class="pl-v">In</span> [<span class="pl-c1">34</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">rand</span>(<span class="pl-c1">3</span>,<span class="pl-c1">3</span>), <span class="pl-s1">columns</span><span class="pl-c1">=</span><span class="pl-en">list</span>(<span class="pl-s">'ABC'</span>), <span class="pl-s1">index</span><span class="pl-c1">=</span><span class="pl-en">list</span>(<span class="pl-s">'aab'</span>))

<span class="pl-v">In</span> [<span class="pl-c1">35</span>]: <span class="pl-s1">df</span>
<span class="pl-v">Out</span>[<span class="pl-c1">35</span>]:
          <span class="pl-v">A</span>         <span class="pl-v">B</span>         <span class="pl-v">C</span>
<span class="pl-s1">a</span>  <span class="pl-c1">0.031057</span>  <span class="pl-c1">0.528825</span>  <span class="pl-c1">0.694592</span>
<span class="pl-s1">a</span>  <span class="pl-c1">0.705572</span>  <span class="pl-c1">0.122005</span>  <span class="pl-c1">0.754107</span>
<span class="pl-s1">b</span>  <span class="pl-c1">0.475423</span>  <span class="pl-c1">0.048636</span>  <span class="pl-c1">0.224495</span>

<span class="pl-v">In</span> [<span class="pl-c1">36</span>]: <span class="pl-s1">df</span>.<span class="pl-en">irow</span>(<span class="pl-c1">0</span>)
<span class="pl-v">Out</span>[<span class="pl-c1">36</span>]:
          <span class="pl-v">A</span>         <span class="pl-v">B</span>         <span class="pl-v">C</span>
<span class="pl-s1">a</span>  <span class="pl-c1">0.031057</span>  <span class="pl-c1">0.528825</span>  <span class="pl-c1">0.694592</span>
<span class="pl-s1">a</span>  <span class="pl-c1">0.705572</span>  <span class="pl-c1">0.122005</span>  <span class="pl-c1">0.754107</span>

<span class="pl-v">In</span> [<span class="pl-c1">37</span>]: <span class="pl-s1">df</span>.<span class="pl-en">irow</span>(<span class="pl-c1">1</span>)
<span class="pl-v">Out</span>[<span class="pl-c1">37</span>]:
          <span class="pl-v">A</span>         <span class="pl-v">B</span>         <span class="pl-v">C</span>
<span class="pl-s1">a</span>  <span class="pl-c1">0.031057</span>  <span class="pl-c1">0.528825</span>  <span class="pl-c1">0.694592</span>
<span class="pl-s1">a</span>  <span class="pl-c1">0.705572</span>  <span class="pl-c1">0.122005</span>  <span class="pl-c1">0.754107</span>

<span class="pl-v">In</span> [<span class="pl-c1">38</span>]: <span class="pl-s1">df</span>.<span class="pl-en">irow</span>(<span class="pl-c1">2</span>)
<span class="pl-v">Out</span>[<span class="pl-c1">38</span>]:
<span class="pl-v">A</span>    <span class="pl-c1">0.475423</span>
<span class="pl-v">B</span>    <span class="pl-c1">0.048636</span>
<span class="pl-v">C</span>    <span class="pl-c1">0.224495</span>
<span class="pl-v">Name</span>: <span class="pl-s1">b</span></pre></div>
<p dir="auto">If you give a non-existent key to the subset argument it will default to the last column. For example:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="In [3]: d = pd.DataFrame({'a':[1],'b':[2],'c':[np.nan]})
In [4]: len(d.dropna(subset=['x']))
Out[4]: 0"><pre class="notranslate"><code class="notranslate">In [3]: d = pd.DataFrame({'a':[1],'b':[2],'c':[np.nan]})
In [4]: len(d.dropna(subset=['x']))
Out[4]: 0
</code></pre></div>
<p dir="auto">It seems the problem is in the line where dropna takes the subset:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="agg_obj = self.take(ax.get_indexer_for(subset),axis=agg_axis)"><pre class="notranslate"><code class="notranslate">agg_obj = self.take(ax.get_indexer_for(subset),axis=agg_axis)
</code></pre></div>
<p dir="auto">Here, <code class="notranslate">ax.get_indexer_for(subset)</code> will return <code class="notranslate">-1</code> as a sentinel value for any keys that were not found in <code class="notranslate">subset</code>, and <code class="notranslate">self.take</code> interprets the <code class="notranslate">-1</code> as a request for the last column.</p>