title: How to convert the value_counts() output into a dataframe?
body: <p>I have a dataframe like this:</p>
  
  <pre><code>match       team1       team2       winner
  1            MI           KKR        MI
  2            DD           CSK        DD
  3            RCB          DC         RCB.....
  </code></pre>
  
  <p>What I wanted to calculate is how many times has a team won against another team in the tournament. Like for <strong>MI vs KKR:</strong></p>
  
  <p>MI:10</p>
  
  <p>KKR:5</p>
  
  <p>So I have written a function like this:</p>
  
  <pre><code>def comparator(team1):
      mt1=matches[((matches['team1']==team1)|(matches['team2']==team1))]
      teams=['MI','KKR','RCB','DC','CSK','RR','DD','GL','KXIP','SRH','RPS','KTK','PW']
      teams.remove(team1)
      opponents=teams.copy()
      for i in opponents:
          mt2=mt1[(((mt1['team1']==i)|(mt1['team2']==i)))&amp;((mt1['team1']==team1)|(mt1['team2']==team1))].winner.value_counts()
          print(mt2)
  comparator('MI')
  </code></pre>
  
  <p>Now in the function, the <strong>mt2</strong> prints out the correct values for the respective wins for team1 and team2. The output is like this:</p>
  
  <pre><code>MI     13
  KKR     5
  Name: winner, dtype: int64
  MI     11
  RCB     8
  Name: winner, dtype: int64
  </code></pre>
  
  <p>Now the output is correct but the format is not appropriate. I want to convert the following output into a dataframe.</p>
  
  <p>I tried appending the the values into a list but it is not working as the lines <strong>Name: winner, dtype: int64</strong> is also getting appended into the list.</p>
  
  <p>How do I convert it into a dataframe? </p>