I am trying to filter a dataframe in pyspark using a list. I want to either filter based on the list or include only those records with a value in the list. My code below
based on @user3133475 answer, it is also possible to call the isin() method from F.col() like this:
isin()
F.col()
import pyspark.sql.functions as F l = [10,18,20] df.filter(F.col("score").isin(l))