Skip to content
Advertisement

pyspark – filter rows containing set of special characters

I have a data frame as follow:-

JavaScript

Now I want to find the count of total special characters present in each column. So I have used str. contains function to find it, though it is running but it does not find the special characters.

JavaScript

Advertisement

Answer

You may want to use rlike instead of contains, which allows to search for regular expressions

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement