title: Pandas groupby, get ratio of boolean variable
body: <p>Given a dataframe with a boolean columns, what would be the most efficient way to calculate the ratio of the boolean value?</p>
  
  <p>Example:</p>
  
  <pre><code>df = pd.DataFrame.from_dict({'Group': ['A', 'A', 'A', 'A', 'B', 'B','B'], 'Val': [True, True, False, False, True, False, False]})
  
    Group    Val
  0     A   True
  1     A   True
  2     A  False
  3     A  False
  4     B   True
  5     B  False
  6     B  False
  </code></pre>
  
  <p>I am looking to get a dataframe which will look like this</p>
  
  <pre><code>  Group    Ratio
  0     A    0.5
  1     B    0.33333333
  </code></pre>