I'm new in pyspark . I write this code in pyspark:
def filterOut2(line):
return [x for x in line if x != 2]
filtered_lists = data.map(filterOut2)
but I get this error:
'list' object has no attribute 'map'
How do I perform a map operation specifically on my data in PySpark in a way that allows me to filter my data to only those values for which my condition evaluates to true?