title: Change value at columns when finding values at column on the right for multiple pairs of columns without loop
body: <p>I have a matrix like this</p>
  
  <pre><code>+------+---+-------+---+-----+---+
  | 2.80 | 5 | 45.02 | 2 | 0.2 | 2 |
  | 3.40 | 1 | 34.21 | 2 | 1.2 | 2 |
  | 5.84 | 2 | 98.10 | 2 | 3.4 | 5 |
  | 3.85 | 4 | 73.10 | 5 | 2.3 | 5 |
  | 2.10 | 5 | 32.12 | 1 | 0.3 | 4 |
  +------+---+-------+---+-----+---+
  </code></pre>
  
  <p>And I want to change the value at the columns 1, 3 and 5 to <code>NaN</code> every time the value at the column immediately at right is equal to 4 or 5:</p>
  
  <pre><code>+------+---+-------+---+-----+---+
  | NaN  | 5 | 45.02 | 2 | 0.2 | 2 |
  | 3.40 | 1 | 34.21 | 2 | 1.2 | 2 |
  | 5.84 | 2 | 98.10 | 2 | NaN | 5 |
  | NaN  | 4 | NaN   | 5 | NaN | 5 |
  | NaN  | 5 | 32.12 | 1 | NaN | 4 |
  +------+---+-------+---+-----+---+
  </code></pre>
  
  <p>For example, at row 1, column 2, the value is 5, so row 1, column 1 must be changed to<code>NaN</code>.</p>
  
  <p>I can do it with a loop, but once my data is really big I'm losing a lot of time on it. I would like to save time doing it without a loop, but I'm failing on it.</p>