Pandas multi-index count occurrences
<p>I have a Pandas DataFrame with MultiIndexing</p>

<pre><code>(Index col 1) (Index col 2) (Data col 1) ....
A               a            word1
                a            word2
                b            word3
B               a            word4
                c            word5
</code></pre>

<p>Now I want to count all the rows that have the same combination of Index column 1 and Index column 2. I've tried df.value_counts(), which gives the error 'DataFrame does not have a method value_counts(). If I use df.count(), I can only count for level=0 or level=1, not both at the same time (the level parameter does not seem to accept a list, even though I often see that used on stackoverflow).</p>

<p>Desired output:
A a 2
A b 1
.. etc</p>

<p>[EDIT]: OK so @EdChum's comment solved the problem, but I am still wondering why the other stuff did not work? Specifically: why does value_counts not seem to be defined while it is part of the latest Pandas? Does this have anything to do with me using a Jupyter Notebook? Or do these things change a lot between Pandas versions?</p>