soundex

In [ ]:
soundex(expr1,)

Returns the Soundex encoding of varchar strings as a four-character string.

Parameters

Name Type Optional Description
expr
object
❌
Expression.

Returns

str_sql : SQL expression.

Example

In [6]:
from verticapy import *
df = tablesample({"x": ['hello', 'apple', 'heroes', 'allo']}).to_vdf()
display(df)
Abc
x
Varchar(6)
1hello
2apple
3heroes
4allo
Rows: 1-4 | Column: x | Type: varchar(6)
In [8]:
# Importing the stats module
import verticapy.stats as st

# Applying the week function
df["soundex_x"] = st.soundex(df["x"],)
display(df)
Abc
x
Varchar(6)
Abc
soundex_x
Varchar(4)
1helloH400
2appleA140
3heroesH620
4alloA400
Rows: 1-4 | Columns: 2