jaro_winkler_distance

In [ ]:
jaro_winkler_distance(expr1, 
                      expr2,)

Calculates and returns the Jaro-Winkler distance between two strings.

Parameters

Name Type Optional Description
expr1
object
Expression.
expr2
object
Expression.

Returns

str_sql : SQL expression.

Example

In [10]:
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 [11]:
# Importing the stats module
import verticapy.stats as st

# Applying the week function
df["jaro_winkler_distance_x"] = st.jaro_winkler_distance(df["x"], 'heyllow')
display(df)
Abc
x
Varchar(6)
123
jaro_winkler_distance_x
Float(22)
1hello0.923809523809524
2apple0.447619047619048
3heroes0.714285714285714
4allo0.726190476190476
Rows: 1-4 | Columns: 2