title: I want to fill Missing value with last row value in Pyspark:
body: <p>My <code>df</code> has multiple columns</p>
  
  <p>Query I tried:</p>
  
  <pre><code>df=df.withColumn('Column_required',F.when(df.Column_present&gt;1,df.Column_present).otherwise(lag(df.Column_present))
  </code></pre>
  
  <p>Not able to work on otherwise.
  . Column on which I want operation:</p>
  
  <pre><code>Column_present       Column_required
  40000                 40000
  Null                  40000
  Null                  40000
  500                   500
  Null                  500
  Null                  500
  </code></pre>