Pyspark dataframe operator “IS NOT IN”

后端 未结 7 1485
轮回少年
轮回少年 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条回答
  • 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)
    
    0 讨论(0)
提交回复
热议问题