Compute pairwise element of two 1D array
问题 Here is my problem : let's say my two array are : import numpy as np first = np.array(["hello", "hello", "hellllo"]) second = np.array(["hlo", "halo", "alle"]) Now I want to get the matrix of distance between each element of the two arrays so for example my distance function is : def diff_len(string1, string2): return abs(len(string1) - len(string2)) So I I would like to get the matrix : hello hello hellllo hlo result1 result2 result3 halo result4 result5 result6 alle result7 result8 result9