Created
June 13, 2020 11:37
-
-
Save kovid-r/6724298aa0c9feb1090c2f2745666b8c to your computer and use it in GitHub Desktop.
Using where to filter PySpark Cheatsheet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Finding info of Ace Ventura films | |
df.where(F.lower(F.col('title')).like("%ace%")).show() | |
# Another way to do this | |
df.where("title like '%ace%'").show() | |
# Using where clause in sequence | |
df.where(df.year != '1998').where(df.avg_ratings >= 6.0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment