How to replace string in a column with some value

Replace string in a column with some value



Let suppose we have a dataframe with column name as 'product_name' and it has comma in between string we need to remove comma in string.

from pyspark.sql.functions import regex_replace

df.withColumn("product_name", regex_replace(col("product_name"),   ','  , ''))







Comments