title: Cannot get access to pandas DataFrame in the way expected
body: <p>I have a strange dataframe, that doesn't seem to operate in the way I expect. I should have a column heading that I can use.</p>
  <p>The code I have produces the following, which is supposed to be used for a histogram.</p>
  <pre><code>categories = pd.Series(df['category'])
  category_freq = pd.Series(df[df['engine'] == 'u']['category'])
  hist = pd.crosstab(category_freq, categories)
  counts = pd.DataFrame(np.diag(hist), index=[hist.index])
  </code></pre>
  <p>But the output has a <code>'0'</code> at the very top. I cannot seem to get things behaving as I would want. For example the output looks like the following:</p>
  <pre><code>0
  category    
  baby        65    
  beauty      73
  christmas   168
  </code></pre>
  <p>If I access via <code>counts[0]</code>, I can remove this &quot;top layer&quot;, but I can never find a way to access rows via say <code>counts[0]['category']</code>. I get key not found. How can I get the data in a format that works as DataFrame?</p>