Reputation: 523
I want all rows whose their value in column col1
is equal to yes
. in pandas I can get like this
df[df['col1']=='yes']
how is it in pyspark?
Upvotes: 0
Views: 2306
Reputation: 674
You can use the filter method from the DataFrame.
df.filter(df["col1"] == "yes")
or
df.filter("col1 == 'yes'")
Upvotes: 2