pandas series drop when multiindex is not unique
<p>consider the <code>pd.Series</code> <code>s</code></p>

<pre><code>midx = pd.MultiIndex.from_product([list('ABC'), np.arange(3)])
s = pd.Series(1, midx)
s

A  0    1
   1    1
   2    1
B  0    1
   1    1
   2    1
C  0    1
   1    1
   2    1
dtype: int64
</code></pre>

<p>It is very convenient to use <code>drop</code> to get rid of cross sections.  For example</p>

<pre><code>s.drop('A')

B  0    1
   1    1
   2    1
C  0    1
   1    1
   2    1
dtype: int64
</code></pre>

<p>But if I make the index non-unique</p>

<pre><code>s = s.append(pd.Series(0, pd.MultiIndex.from_tuples([('A', 2)]))).sort_index()
s

A  0    1
   1    1
   2    1
   2    0
B  0    1
   1    1
   2    1
C  0    1
   1    1
   2    1
dtype: int64
</code></pre>

<p>Then the same <code>drop</code> no longer works.</p>

<pre><code>s.drop('A')

A  0    1
   1    1
   2    1
   2    0
B  0    1
   1    1
   2    1
C  0    1
   1    1
   2    1
dtype: int64
</code></pre>

<p>How do I drop like before</p>

<p>The desired result should be (this doesn't work, what does)</p>

<pre><code>s.drop('B')

A  0    1
   1    1
   2    1
   2    0
C  0    1
   1    1
   2    1
dtype: int64
</code></pre>

<p>I'm not sure why the <code>s.drop('B')</code> doesn't work but using the <code>level=0</code> parameter does.</p>

<pre><code>s.drop('B', level=0)

A  0    1
   1    1
   2    1
   2    0
C  0    1
   1    1
   2    1
dtype: int64
</code></pre>

python pandas multi-index