Pyspark dataframe operator “IS NOT IN”

后端 未结 7 1513
轮回少年
轮回少年 2020-12-08 14:15

I would like to rewrite this from R to Pyspark, any nice looking suggestions?

array <- c(1,2,3)
dataset <- filter(!(column %in% array))
7条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-08 15:07

    You can also loop the array and filter:

    array = [1, 2, 3]
    for i in array:
        df = df.filter(df["column"] != i)
    

提交回复
热议问题