To fix this issue So I have multiple lists: , Maybe something like this could be a starting point:

code :

```
import numpy as np
# I'll use numbers instead of words,
# but same exact concept
points_list = [[0,1,2],
[0,3],
[1,4],
[0,2]]
scores = np.zeros((5,5))
for points in points_list:
temp = np.array(points)[:, np.newaxis]
scores[temp, points] += 1
```

```
>>> scores
array([[ 3., 1., 2., 1., 0.],
[ 1., 2., 1., 0., 1.],
[ 2., 1., 2., 0., 0.],
[ 1., 0., 0., 1., 0.],
[ 0., 1., 0., 0., 1.]])
```

```
import numpy as np
# I'll use numbers instead of words,
# but same exact concept
points_list = [[0,1,2],
[0,3],
[1,4],
[0,2],
[0,1,2,3],
[0,1,2,4]]
scores = np.zeros((5,5))
for points in points_list:
temp = np.array(points)[:, np.newaxis]
scores[temp, points] += 1
diag = scores.diagonal()
key_col = (scores/diag)[:, 0]
key_col[0] = 0
points_2 = np.where(key_col > 0.5)[0] # suppose 0.5 is the threshold
temp_2 = np.array(points_2)[:, np.newaxis] # step 1: we identified the points that are
# close to 0
inner_scores = scores[temp_2, points_2] # step 1: we are checking if those points are
# are close to each other
```

```
>>> scores
array([[ 5., 3., 4., 2., 1.], # We identified that 1 and 2 are close to 0
[ 3., 4., 3., 1., 2.],
[ 4., 3., 4., 1., 1.],
[ 2., 1., 1., 2., 0.],
[ 1., 2., 1., 0., 2.]])
>>> inner_scores
array([[ 4., 3.], # Testing to see whether 1 and 2 are close together
[ 3., 4.]]) # Since they are, we can conclude that (0,1,2) occur
# together
```