df = spark.createDataFrame([(1.0,100.0, float('nan')), (float('nan'),100.0, 2.0)], ("a", "b")) df.select(F.max(df.a)).show()
the result is :
+------+ |max(a)| +------+ | NaN| +------+
I didn't want the NaN,how can I do?
you can do
df.na.fill(0)
before you apply your max filter
max