0

I want to pass a string column of PySpark dataframe to re.findall() function. How should I do that?

I tried using re.findall('capturinggroup',F.col("Col_Name")). But I am getting an error called "expected string or bytes-like object"

Mission
  • 31
  • 3
  • You need to turn things around, and use the Pyspark functions for running the regex on the column. Like the error message tells you, `re.findall` accepts a string as its second argument, not a column. – tripleee Nov 07 '22 at 10:15
  • see `regexp_extract` function – samkart Nov 07 '22 at 10:39

0 Answers0