title: Select rows that contains values repeated across different levels of another column
body: <p>I have a dataset with two columns</p>
  <pre><code>    id  to
  0   1   0x954b890704693af242613edef1b603825afcd708
  1   1   0x954b890704693af242613edef1b603825afcd708
  2   1   0x607f4c5bb672230e8672085532f7e901544a7375
  3   1   0x9b9647431632af44be02ddd22477ed94d14aacaa
  4   2   0x9b9647431632af44be02ddd22477ed94d14aacaa
  </code></pre>
  <p>and I would like to print the value in column 'to' that is present in different levels of the column 'id', in the above example for example the only value to be printed should be 0x9b9647431632af44be02ddd22477ed94d14aacaa</p>
  <p>I have done this with a for loop within, i wonder it there is a better way of doing this:</p>
  <pre><code>for index, row in df.iterrows():
    to=row['to']
    id=row['id']
    for index, row in df.iterrows():
      if row['to']==to and row['id']!=id:
        print(to)
  </code></pre>