title: adding new column to pandas dataframe with values for particular items?
body: <p>I have this pandas dataframe:</p>
  
  <pre><code>d=pandas.DataFrame([{"a": 1}, {"a": 3, "b": 2}])
  </code></pre>
  
  <p>and I'm trying to add a new column to it with non-null values only for certain rows, based on their numeric indices in the array. for example, adding a new column "c" only to the first row in <code>d</code>:</p>
  
  <pre><code># array of row indices
  indx = np.array([0])
  d.ix[indx]["c"] = "foo"
  </code></pre>
  
  <p>which should add "foo" as the column "c" value for the first row, and NaN for all other rows. but this doesn't seem to change the array:</p>
  
  <pre><code>d.ix[np.array([0])]["c"] = "foo"
  In [18]: d
  Out[18]: 
     a   b
  0  1 NaN
  1  3   2
  </code></pre>
  
  <p>what am I doing wrong here? how can it be done? thanks.</p>