【发布时间】:2023-01-09 18:08:16
【问题描述】:
我有一个包含三列的数据集,col 1:country(String),col 2:threshold_1(bool),col 3:threshold_2(bool)
我正在尝试使用此逻辑创建一个新列,但出现错误
我正在为此使用 Palantir 代码工作簿,谁能告诉我我在这里缺少什么?
df = df.withColumn("Threshold_Filter",
when(df["country"]=="INDIA" & df["threshold_1"]==True | df["threshold_2 "]==True, "Ind_country"
).otherwise("Dif_country"))
【问题讨论】:
标签: apache-spark pyspark palantir-foundry foundry-code-repositories foundry-code-workbooks