title: Can I shift specific values in one data column to another column while keeping the other values unchanged?
body: <p>Here is an example dataset that I have:</p>
  <pre><code>C1      C2
   1       1
  NaN      1
   2       0
  NaN      0
  NaN      1
   1       1
   2       2
   2       2
  NaN      1
  </code></pre>
  <p>I want to take all the values that have &quot;1&quot; in them in the Column &quot;C2&quot; and shift them to replace the adjacent values in column &quot;C1&quot;.</p>
  <p>So the output should look like:</p>
  <pre><code>C1      C2
   1       1
   1       1
   2       0
   NaN     0
   1       1
   1       1
   2       2
   2       2
   1       1
  
  </code></pre>
  <p>Alternatively, I could create a new column with these values replaced. Main point is, that I need all the &quot;1s&quot; in C2 TO replace the NaN values in C1.</p>
  <p>I can't do find all NaN and replace with 1, because there are some NaN values that should stay in C1.</p>
  <p>Is there a way to do this?</p>
  <p>Thanks for the help in advance.</p>