PySpark replace null in column with value in other column : <p>I want to replace null values in one column with the values in an adjacent column ,for example if i have</p>

<pre><code>A|B
0,1
2,null
3,null
4,2
</code></pre>

<p>I want it to be:</p>

<pre><code>A|B
0,1
2,2
3,3
4,2
</code></pre>

<p>Tried with</p>

<pre><code>df.na.fill(df.A,"B")
</code></pre>

<p>But didnt work, it says  value should be a float, int, long, string, or dict</p>

<p>Any ideas?</p>
