Pyspark replace strings in Spark dataframe column

后端 未结 2 1547
轮回少年
轮回少年 2020-12-02 20:23

I\'d like to perform some basic stemming on a Spark Dataframe column by replacing substrings. What\'s the quickest way to do this?

In my current use case, I have a

2条回答
  •  隐瞒了意图╮
    2020-12-02 20:43

    For scala

    import org.apache.spark.sql.functions.regexp_replace
    import org.apache.spark.sql.functions.col
    data.withColumn("addr_new", regexp_replace(col("addr_line"), "\\*", ""))
    

提交回复
热议问题