I am new to Pyspark
I have this piece of code:
df2 = df.withColumn("VALUE", F.when(col('DIFF') < -900000, None).otherwise(col('VALUE')))
Is it possible to add another condition in the when clause, something like:
df2 = df.withColumn("VALUE", F.when(col('DIFF') < -900000 | col('DIFF') > 900000, None).otherwise(col('VALUE')))
However, this throws an Method does not exist error.
Any ideas?
Thanks in advance.