title: how to change values of rows based on groupby
body: <p>I have the following df:</p>
  <pre><code>    df = pd.DataFrame({'ID':[1,1,1,1,1,2,2,3],'ALGO':['A','A','B','B','B','B','B','A'],'VALUES':[0.8,0.2,0.4,0.3,0.3,0.8,0.2,1]})
  
      ID  ALGO    VALUES
  0   1   A   0.80
  1   1   A   0.20
  2   1   B   0.40
  3   1   B   0.30
  4   1   B   0.30
  5   2   B   0.80
  6   2   B   0.20
  7   3   A   1.00
  </code></pre>
  <p>I wish to <strong>change</strong> the VALUES (x10) if the ID's Algo has A. So in the above df only ID 1 and 3 has A's algo hence, the values should be x10.</p>
  <p>To achieve this I do:</p>
  <pre><code>def foo(id_data):     
      if any(id_data['ALGO']=='A'):
          id_data['VALUES']=id_data['VALUES']*10
      return id_data['VALUES']
  
  new_column  = df.groupby('ID').apply(lambda x: foo(x))
  df[&quot;VALUES&quot;] = new_column.reset_index(level=0, drop=True)
  </code></pre>
  <p>desired results:</p>
  <pre><code>    ID  ALGO    VALUES
  0   1   A   8.00
  1   1   A   2.00
  2   1   B   4.00
  3   1   B   3.00
  4   1   B   3.00
  5   2   B   0.80
  6   2   B   0.20
  7   3   A   10.00
  </code></pre>
  <p>My Question: say I wish to iterate over the group of IDs and make the adjustment there (inside my for loop), how should it be done?</p>
  <pre><code>m = df.groupby(['ID'])
  for i in m:
      if any(i['ALGO']=='A'): //this of course will not work
            i['VALUES']=i['VALUES']*10
  </code></pre>