pyspark.sql.functions.soundex#

pyspark.sql.functions.soundex(col)[source]#

Returns the SoundEx encoding for a string

New in version 1.5.0.

Changed in version 3.4.0: Supports Spark Connect.

Parameters
colColumn or str

target column to work on.

Returns
Column

SoundEx encoded string.

Examples

>>> df = spark.createDataFrame([("Peters",),("Uhrbach",)], ['name'])
>>> df.select(soundex(df.name).alias("soundex")).collect()
[Row(soundex='P362'), Row(soundex='U612')]