title: python pivot table of counts
body: <p>I have a dataframe df as follows:</p>
  
  <pre><code>| id | movie | value |
  |----|-------|-------|
  | 1  | a     | 0     |
  | 2  | a     | 0     |
  | 3  | a     | 20    |
  | 4  | a     | 0     |
  | 5  | a     | 10    |
  | 6  | a     | 0     |
  | 7  | a     | 20    |
  | 8  | b     | 0     |
  | 9  | b     | 0     |
  | 10 | b     | 30    |
  | 11 | b     | 30    |
  | 12 | b     | 30    |
  | 13 | b     | 10    |
  | 14 | c     | 40    |
  | 15 | c     | 40    |
  </code></pre>
  
  <p>I want to create a 2X2 pivot table of counts as follows:</p>
  
  <pre><code>| Value | count(a) | count(b) | count ( C ) |
  |-------|----------|----------|-------------|
  | 0     | 4        | 2        | 0           |
  | 10    | 1        | 1        | 0           |
  | 20    | 2        | 0        | 0           |
  | 30    | 0        | 3        | 0           |
  | 40    | 0        | 0        | 2           |
  </code></pre>
  
  <p>I can do this very easily in Excel using Row and Column Labels. How can I do this using Python?</p>