
In this post, we will learn how to use filter condition in pyspark with example.
Sample program using filter condition
We will create a dataframe using the following sample program.
Then we filter the dataframe based on marks and store the result in another dataframe.
The following classes imported at the beginning of the code.
Output
The following dataframes created as the result of the above sample program.
Here this filter condition helps us to filter the records having marks as 480 from the dataframe.
Must use double equal to inside the filter condition.
I hope that everyone got an idea about how to use filter condition in pyspark now.
Reference
Related Articles
https://beginnersbug.com/where-condition-in-pyspark-with-example/