title: Count the latest same values from column python
body: <p>i have data like this:</p>
  <pre><code>   id   a   b   c   d
      1   y   y   z   z
      2   y   z   y   y
      3   y   y   y   y
  </code></pre>
  <p>i want to count value <code>&quot;y&quot;</code> from column <code>a b c d</code> from the last it change like this:</p>
  <pre><code>id    count_y
  1     2
  2     1
  3     4
  </code></pre>
  <p>could you please help me with this?</p>