title: How can I rename a column based on a cell value in Pyspark?
body: <p>Currently I have this Situation:</p>
  <pre><code>   signal_name  timestamp   signal_value
  0  alert        1632733513  on
  1  alert        1632733515  off
  2  alert        1632733518  on
  </code></pre>
  <p>I want to rename the column <code>signal_value</code> with the <code>signal_name</code>. The df was filtered after the signal name <code>alert</code> so there is no other value for <code>signal_name</code>.</p>
  <pre><code>   signal_name  timestamp   alert
  0  alert        1632733513  on
  1  alert        1632733515  off
  2  alert        1632733518  on
  </code></pre>
  <p>Due to the fact that the signal name is addressed, the first column is no longer needed. So I would like to drop it.</p>
  <pre><code>   timestamp    alert
  0  1632733513   on
  1  1632733515   off
  2  1632733518   on
  </code></pre>
  <p>Since there are multiple df (based on other <code>signal_name</code>) with this problem, this approach should be generic.</p>