title: how to make nullable = true, When using withcolumn to create a binary column of 1 and 0,
body: <p>this is the code that I'm using</p>
  <pre><code>dfn = df.withColumn(&quot;id&quot;,F.when(F.col(&quot;number1&quot;) &gt; F.col(&quot;number2&quot;), 1 ).otherwise(0))
  </code></pre>
  <h3>Problem:</h3>
  <p>it returns <code>integerType</code> and <code>nullable = false</code>.</p>
  <h3>Goal:</h3>
  <p>I want it <code>doubleType</code> and <code>nullable = true</code></p>
  <p>thanks a lot in advance</p>