Reputation: 23
I have a spark dataframe like below
Id value
1 \N
2 \N
3 a
4 b
5 \N
I want to remove the \N
records, which are null, from the df. How to do this?
Upvotes: 0
Views: 57
Reputation: 6644
the simple filter
should work.
data_sdf.filter(data_sdf.value != r'\N').show()
# +---+-----+
# | id|value|
# +---+-----+
# | 3| a|
# | 4| b|
# +---+-----+
Upvotes: 1