title: count occurrences of number by column in pandas data frame
body: <p>I have a pandas data frame I want to count how often a number appears in a column for each column</p>
  
  <pre><code>     a   b   c   d   e
  0    2   3   1   5   4
  1    1   3   2   5   4
  2    1   3   2   5   4
  3    2   4   1   5   3
  4    2   4   1   5   3
  </code></pre>
  
  <p>This is my code that does not work</p>
  
  <pre><code>def equalsOne(x):
      x[x.columns == 1].sum()
  
  df1.apply(equalOne(), axis = 1)
  </code></pre>
  
  <p>Here is the desired output</p>
  
  <pre><code>a 2
  b 0
  c 3
  d 0
  e 0 
  </code></pre>