我需要在pyspark中将异常值替换为null
df = df.withColumn("rpm", when(df["rpm"] >= 750, None).otherwise(df["rpm"]))
但是我得到这个错误:
TypeError: condition should be a Column
Anky的上述评论有效。谢谢。
df.withColumn("rpm", when(col("rpm") >= 750, None).otherwise(col("rpm")))
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句