title: Pandas: Update record if exists
body: <p>I have a dataframe, df. It has two columns <code>category</code> and <code>description</code>. Neither <code>category</code> or <code>description</code> are part of the index.</p>
  
  <p>I am looping around some other data then adding categories (variable=temp_category) one by one to my dataframe. If the <code>category</code> already exists, I want to get the <code>description</code> from the dataframe, append some text to it and then update the record.</p>
  
  <p>If the record doesn't exist I am simply appending a new record with df.append</p>
  
  <p>I'm using this to determine if the category already exists in the dataframe:</p>
  
  <p><code>if df.ix[df['category'] == temp_category]['category'].count() &gt; 0:</code></p>
  
  <p>My questions are:</p>
  
  <ul>
  <li>How do I update the record?</li>
  <li>Is the <code>if</code> statement above the simplest way to see if <code>temp_category</code> exists in the dataframe?</li>
  </ul>