Pyspark dataframe operator “IS NOT IN”

后端 未结 7 1501
轮回少年
轮回少年 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 14:50

    Take the operator ~ which means contrary :

    df_filtered = df.filter(~df["column_name"].isin([1, 2, 3]))
    

提交回复
热议问题