title: Replace single value in a pandas dataframe, when index is not known and values in column are unique
body: <p>There is <a href="https://stackoverflow.com/questions/13842088/set-value-for-particular-cell-in-pandas-dataframe">a question on SO with the title "Set value for particular cell in pandas DataFrame"</a>, but it assumes the row index is known. How do I change a value, if the row values in the relevant column are unique? Is using <a href="https://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.set_index.html" rel="nofollow noreferrer">set_index</a> as below the easiest option? Returning a list of index values with <a href="https://pandas.pydata.org/pandas-docs/stable/generated/pandas.Index.tolist.html" rel="nofollow noreferrer">index.tolist</a> does not seem like a very elegant solution.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>import pandas as pd
  
  ## Fill the data frame.
  df = pd.DataFrame([[1, 2], [3, 4]], columns=('a', 'b'))
  print(df, end='\n\n')
  
  ## Just use the index, if we know it.
  index = 0
  df.set_value(index, 'a', 5)
  print('set_value', df, sep='\n', end='\n\n')
  
  ## Define a new index column.
  df.set_index('a', inplace=True)
  print('set_index', df, sep='\n', end='\n\n')
  
  ## Use the index values of column A, which are known to us.
  index = 3
  df.set_value(index, 'b', 6)
  print('set_value', df, sep='\n', end='\n\n')
  
  ## Reset the index.
  df.reset_index(inplace = True)
  print('reset_index', df, sep='\n')
  </code></pre>
  
  <p>Here is my output:</p>
  
  <pre><code>   a  b
  0  1  2
  1  3  4
  
  set_value
     a  b
  0  5  2
  1  3  4
  
  set_index
     b
  a   
  5  2
  3  4
  
  set_value
     b
  a   
  5  2
  3  6
  
  reset_index
     a  b
  0  5  2
  1  3  6
  </code></pre>