pyspark: counter part of like() method in dataframe

Viewed 21298

Is there any counter method for like() in spark dataframe (something as notLike())?

Or is there any other way to do it except using the traditonal SQL query?

I want to do just the opposite of the following:

df.where(col("_c2").like("XY6%")).show(5)
3 Answers

Or you can do :

df.where( col("_c2").like("XY6%") == False ).show(5)

For two condition we can do this way:

df.where((~col("_c2").like("XY6%")) & (~col("_c2").like("X6%")))
Related