title: Heatmap of counts of every value in every column
body: <p>I have a dataframe that is like this:</p>
  <pre><code>| A | B | C  | D |  
  |---|---|----|---|  
  | 1 | 3 | 10 | 4 |  
  | 2 | 3 | 1  | 5 |  
  | 1 | 7 | 9  | 3 |  
  </code></pre>
  <p>Where A B C D are categories, and the values are in the range [1, 10] (some values might not appear in a single column)</p>
  <p>I would like to have a dataframe that for every category shows the count of those values. Something like this:</p>
  <pre><code>|    | A | B  | C | D |
  |----|---|----|---|---|  
  | 1  | 2 | 0  | 1 | 0 |
  | 2  | 1 | 0  | 0 | 0 |
  | 3  | 0 | 2  | 0 | 1 |
  | 4  | 0 | 0  | 0 | 1 |
  | 5  | 0 | 0  | 0 | 1 |
  | 6  | 0 | 0  | 0 | 0 |
  | 7  | 0 | 1  | 0 | 0 |
  | 8  | 0 | 0  | 0 | 0 |
  | 9  | 0 | 0  | 1 | 0 |
  | 10 | 0 | 0  | 1 | 0 | 
  </code></pre>
  <p>I tried using <code>groupby</code> and <code>pivot_table</code> but I can't seem to understand what parameters to give.</p>