title: Summing in a group with multiplying with constant in pandas
body: <p>I have a dataframe <code>df</code></p>
  
  <pre><code>id    value  text  route   distance
  1      100   asf     a1    10
  2      200   sdf     a1    30
  3      345   efs     a2    40 
  4      232   asd     a2    60
  5      565   yjy     a2    70
  </code></pre>
  
  <p>What  I'm looking for is  grouping by route and summing distance column and Value column, but adding +20*count(id) for every route.</p>
  
  <p>i.e </p>
  
  <pre><code>for route a1 sum(Value) is 300 + 20*(count of id in  group a1)
  </code></pre>
  
  <p>my final df should look like</p>
  
  <pre><code>route   value    distance
  a1      340      40      #300+(2*20) since count is 2 in group a1
  a2      1202     170    #1142+(3*20) since count is 2 in group a2
  </code></pre>
  
  <p>i can get normal group and sum using aggregate, </p>
  
  <pre><code>x=final_df_results.groupby(['route']).agg({'distance':sum,'value': sum})
  </code></pre>
  
  <p>but it wont help me</p>