title: pandas-percentage count of categorical variable
body: <p>I have a pandas df like</p>
  
  <p><code>df_test = pd.DataFrame({'A': 'a a a b b'.split(), 'B': ['Y','N','Y','Y','N']})</code></p>
  
  <p>and my desired output to be 
  <code>df_test2 = pd.DataFrame({'A': 'a b'.split(), 'B': [2/3,1/2]})</code>
  How would you do a groupby().apply by column A to get the percentage of 'Y' in column B?</p>
  
  <p>I have been searching groupby.apply() but nothing have worked so far
  Thank you ! </p>