1from pyspark.sql.functions import col, when
2
3valueWhenTrue = None # for example
4
5df.withColumn(
6 "existingColumnToUpdate",
7 when(
8 col("userid") == 22650984,
9 valueWhenTrue
10 ).otherwise(col("existingColumnToUpdate"))
11)
12