edit_distance¶
In [ ]:
edit_distance(expr1,
expr2,)
Calculates and returns the Levenshtein distance between the two strings.
Parameters¶
| Name | Type | Optional | Description |
|---|---|---|---|
expr1 | object | ❌ | Expression. |
expr2 | object | ❌ | Expression. |
In [1]:
from verticapy import *
df = tablesample({"x": ['hello', 'apple', 'heroes', 'allo']}).to_vdf()
display(df)
In [3]:
# Importing the stats module
import verticapy.stats as st
# Applying the week function
df["edit_distance_x"] = st.edit_distance(df["x"], 'heyllow')
display(df)
