title: Python + pandas replace column values based in other column with
body: <p>My question is simple,
  let's start with an hypothetical table</p>
  
  <pre><code>| a | b | c |  
  | 0 | 0 | 0 |  
  | 0 | 0 | 0 |  
  | 0 | 1 | 1 |  
  | 0 | 1 | 2 |  
  | 1 | 2 | 3 |  
  | 1 | 2 | 3 |  
  | 1 | 3 | 4 |  
  </code></pre>
  
  <p>This table should be modified, the numbers in column b don't be the same
  existing in column a, and column c don't be the same number in column b.<br>
  So the number should be incremented continually.<br>
  The final should looks like this: </p>
  
  <pre><code>| a | b | c  |  
  | 0 | 2 | 6  |  
  | 0 | 2 | 6  |  
  | 0 | 3 | 7  |  
  | 0 | 3 | 8  |  
  | 1 | 4 | 9  |  
  | 1 | 4 | 9  |  
  | 1 | 5 | 10 |  
  </code></pre>
  
  <p>Finally, has more one table. Based in the last table, since c is child of b and b child of a, this table should be converted in two columns table with  3rd column with the height of each row:  </p>
  
  <pre><code>| parent | child | size |  
  | 0      | 2     | 2    |  
  | 0      | 3     | 2    |  
  | 1      | 4     | 2    |  
  | 1      | 5     | 1    |  
  | 2      | 6     | 2    |  
  | 3      | 7     | 1    |  
  | 3      | 8     | 1    |  
  | 4      | 9     | 2    |  
  | 5      | 10    | 1    |  
  </code></pre>
  
  <p>In this 3rd table, all rows are unique and map all tree using only two columns. The 3rd column is the height of each row, that's means, how many times each pair appears in second table.</p>