title: Changing the Structure of a Dataframe in Python
body: <p>I need help to change the structure to a pandas dataframe with many columns like the example:</p>
  <p>original dataframe:</p>
  <pre><code>| xx | yy | zz | a | b | c | k |
  |:---|:---|:---|:--|:--|:--|:--|
  | x1 | y1 | z1 | 0 | 2 | 1 | 3 |
  | x2 | y2 | z2 | 1 | 0 | 2 | 0 |
  </code></pre>
  <p>I need just the first 3 columns and change the rest</p>
  <p>new dataframe:</p>
  <pre><code>| xx | yy | zz | valor | nueva columna| 
  |:---|:---|:---|:--|:--|
  | x1 | y1 | z1 | 0 | a |
  | x1 | y1 | z1 | 2 | b |
  | x1 | y1 | z1 | 1 | c |
  | x1 | y1 | z1 | 3 | k |
  | x2 | y2 | z2 | 1 | a |
  | x2 | y2 | z2 | 0 | b |
  | x2 | y2 | z2 | 2 | c |
  | x2 | y2 | z2 | 0 | k |
  </code></pre>
  <p>I get a solution with a for loop, but in colab when the columns and rows are many the time is excessive</p>