📜  pyspark 当否则有多个条件 - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:05.749000             🧑  作者: Mango

代码示例1
df5.withColumn("new_column", when(col("code") == "a" | col("code") == "d", "A")
      .when(col("code") == "b" & col("amt") == "4", "B")
      .otherwise("A1")).show()