← string_distance operator page · string/string_distance/hamming_sc/three_differing_positions
pandas ✅ · DuckDB ✅
string_distance(hamming, SC_1, SC_2) with SC_1 = karolin and SC_2 = kathrin, two strings of the same length.
String distances: "Returns the Hamming distance, which is the number of positions at which the corresponding characters are different. Both strings must have the same length."
SC_r is 3, a Number: karolin and kathrin have 7 characters and differ at the 3rd (r and t), the 4th (o and h) and the 5th (l and r).
SC_r := string_distance(hamming, SC_1, SC_2);
| SC_1 | SC_2 |
|---|---|
| karolin | kathrin |
{
"scalars": [
{"name": "SC_1", "type": "String"},
{"name": "SC_2", "type": "String"}
]
}
{
"scalars": [
{"name": "SC_r", "type": "Number", "value": 3}
]
}