title: Assigning a value to a single row for a Pandas DataFrame column
body: <p>I am trying to reassign a value in a single row of a column in a Pandas DataFrame.</p>
  
  <pre><code>import pandas as pd
  import numpy as np
  </code></pre>
  
  <p>Here's the DataFrame:</p>
  
  <pre><code>test_df = pd.DataFrame({'range_total' : [3000,3000,3000,3000,3000,3000,0,2000,2000,1000,1000,1000,1000,1000,1000],
      'high_boundary' : [6,6,6,6,6,6,7,9,9,15,15,15,15,15,15],
      'dist_num' : [1197, 142, 142, 1197, 159, 159, 0, 1000, 1000, 398, 50, 50, 398, 50, 50],
      'round_num_sum' : [2996, 2996, 2996, 2996, 2996, 2996, 0, 2000, 2000, 996, 996, 996, 996, 996, 996]})
  </code></pre>
  
  <p>In my code I subset the DataFrame for each value of <code>high_boundary</code> and find the index(es) of the <code>test_df</code> corresponding to the greatest value of <code>dist_num</code> (picking the first if tied). For this example, I set the index to:</p>
  
  <pre><code>sub_idx = 0 
  </code></pre>
  
  <p>I can access the value using this (and other similar versions) code:</p>
  
  <pre><code>test_df.ix[(test_df.high_boundary == 6), "dist_num"][sub_idx]
  </code></pre>
  
  <p>that returns:</p>
  
  <pre><code>1197
  </code></pre>
  
  <p>But assigning a new value fails:</p>
  
  <pre><code>test_df.ix[(test_df.high_boundary == 6), "dist_num"][sub_idx] = 42
  test_df.ix[(test_df.high_boundary == 6), "dist_num"][sub_idx]
  </code></pre>
  
  <p>which still returns:</p>
  
  <pre><code>1197 
  </code></pre>
  
  <p>But:</p>
  
  <pre><code>test_df.ix[(test_df.high_boundary == 6), "dist_num"] = 42
  test_df.ix[(test_df.high_boundary == 6), "dist_num"]
  </code></pre>
  
  <p>returns:</p>
  
  <pre><code>0    42
  1    42 
  2    42
  3    42
  4    42
  5    42
  Name: dist_num, dtype: int64
  </code></pre>
  
  <p>I appreciate any help. This is my first post, because I've always found what I've needed on SO until now. I'm using version 0.14.0.</p>