title: Pandas DataFrame replace value in 1 column given an index value
body: <p>This seems like something simple. But I've tried several different things and read probably a dozen StackOverflow questions that seemed related.</p>
  
  <p>I have market data for crypto currnecies (BitCoin and others). The Order Book is a list of all the 'asks' and 'bids' for a given currency. I am wanting to store the data in a Pandas DataFrame. (I'm not stuck on using DFs just thought it might provide easier plotting down the road.)</p>
  
  <p>So the setup right now is a DataFrame where the Rate (price) is the Index and it is a float. The quantity of coins available at that price is in a column named Amt.</p>
  
  <p>When I get an update to the Amount at a given Rate I want to simply replace that value. Of all the possible solutions I found this option to be the most intuitive to me:</p>
  
  <pre><code>df.Amt[df.Rate == rate] = new_amt
  </code></pre>
  
  <p>While I don't get any errors from this, when I check to see if the Amt changes I find that it has not. I assume this is one of those copy/slice issues vs working on the DataFrame itself.</p>
  
  <p>Example:</p>
  
  <pre><code>df.head()
  Out[77]: 
         Rate        Amt
  0  0.018021   0.319033
  1  0.018009  29.994000
  2  0.017999  28.121000
  3  0.018042   2.233781
  4  0.018055  13.433394
  
  df.Amt[df.Rate == 0.018021] = 20
  
  df.head()
  Out[79]: 
         Rate        Amt
  0  0.018021   0.319033
  1  0.018009  29.994000
  2  0.017999  28.121000
  3  0.018042   2.233781
  4  0.018055  13.433394
  </code></pre>
  
  <p>What am I missing? I've worked with DFs in the past to change whole columns but not generally just 1 row.</p>