title: modifying values in pandas dataframe
body: <p>Assuming I've the following data frame:</p>
  
  <pre><code>import pandas as pd
  df = pd.DataFrame(['a', 'b', 'c', 'd', 'a', 'c', 'f', 'a'])
  print(df)
  </code></pre>
  
  <p>I can replace any occurrence of 'a' with 'AAA' as follows:</p>
  
  <pre><code>df.columns = ['Letters']   
  for i, x in enumerate(df['Letters']):
      if x == 'a':
          df['Letters'][i] = "AAA"
  print(df)
  </code></pre>
  
  <p>But if I extracted unique row and try to do the same thing, it does not work. </p>
  
  <pre><code>df = pd.DataFrame(['a', 'b', 'c', 'd', 'a', 'c', 'f', 'a'])
  df.columns = ['Letters']
  grouped = df.groupby('Letters')
  index = [gp_keys[0] for gp_keys in grouped.groups.values()]
  unique_df = df.reindex(index)
  print(unique_df) 
  
  for i, x in enumerate(unique_df):
      if x == 'a':
          unique_df.loc[i] = "AAA"
  print(unique_df)
  </code></pre>
  
  <p>I am curious why doing <code>unique_df[i] = "AAA"</code> no longer modifies the data frame values. Even doing <code>unique_df.loc[i] = "AAA"</code> as suggested in the view versus copy post <a href="https://stackoverflow.com/questions/17557650/edit-pandas-dataframe-using-indexes">here</a> seems to make no difference. It seems there is something about the <code>groupby</code> function that makes later modification on the data frame elusive. Any thoughts?</p>