title: how to get percentage of elements which equal to string value
body: <p>How can I get the percentage of by group (<code>name</code>) for <code>t_results</code> equals to "ok" ?</p>
  
  <pre><code>    name   t_result
  0   aaa    ok   
  1   aaa    err_1
  2   bbb    err_1
  3   bbb    ok
  4   aaa    err_2
  5   aaa    ok
  
  
  name, percentage
  aaa   0.5
  bbb   0.5
  </code></pre>