title: Pandas: Index updating and changing value accessed by location
body: <p>I have two index-related questions on Python Pandas dataframes.</p>
  
  <pre><code>import pandas as pd
  import numpy as np
  df = pd.DataFrame({'id' : range(1,9),
                  'B' : ['one', 'one', 'two', 'three',
                         'two', 'three', 'one', 'two'],
                  'amount' : np.random.randn(8)})
  
  df = df.ix[df.B != 'three'] # remove where B = three
  df.index
  &gt;&gt;  Int64Index([0, 1, 2, 4, 6, 7], dtype=int64) # the original index is preserved.
  </code></pre>
  
  <p><strong>1)</strong> I do not understand why the indexing is not automatically updated after I modify the dataframe. Is there a way to automatically update the indexing while modifying a dataframe? If not, what is the most efficient manual way to do this?</p>
  
  <p><strong>2)</strong> I want to be able to set the <code>B</code> column of the 5th element of <code>df</code> to 'three'. But <code>df.iloc[5]['B'] = 'three'</code> does not do that. I checked on the <a href="http://pandas.pydata.org/pandas-docs/dev/indexing.html#indexing-integer" rel="noreferrer">manual</a> but it does not cover how to change a specific cell value accessed by location.</p>
  
  <p>If I were accessing by row name, I could do: <code>df.loc[5,'B'] = 'three'</code> but I don't know what the index access equivalent is.</p>
  
  <p>P.S. <a href="https://stackoverflow.com/questions/13842088/set-value-for-particular-cell-in-pandas-dataframe">Link1</a> and <a href="https://stackoverflow.com/questions/17729853/set-value-for-a-selected-cell-in-pandas-dataframe?lq=1">link2</a> are relevant answers to my second question. However, they do not answer my question. </p>