title: Difference between df.reindex() and df.set_index() methods in pandas
body: <p>I was confused by this, which is very simple but I didn't immediately find the answer on StackOverflow:</p>
  <ul>
  <li><p><code>df.set_index('xcol')</code> makes the column <code>'xcol'</code> become the index (when it is a column of df).</p>
  </li>
  <li><p><code>df.reindex(myList)</code>, however, takes indexes from outside the dataframe, for example, from a list named <code>myList</code> that we defined somewhere else.</p>
  </li>
  </ul>
  <p>However, <code>df.reindex(myList)</code> also changes values to NAs. A simple alternative is: <code>df.index = myList</code></p>
  <p>I hope this post clarifies it! Additions to this post are also welcome!</p>