text_plain_output_1.png
import numpy as np

import pandas as pd

import pandas as pd
data = pd.read_csv('/kaggle/input/docs-for-lsh/docs_for_lsh.csv')

import numpy as np
data = data.values[:, 1:]
np.random.seed(0)
n = 30
m = data.shape[0]
length = data.shape[1]
signMatrix = np.zeros((n, m))

def Jaccard(i, j):
    iData = data[i, :]
    jData = data[j, :]
    count1 = 0
    count2 = 0
    for k in range(length):
        if max(iData[k], jData[k]):
            count1 += 1
        if min(iData[k], jData[k]):
            count2 += 1
    return count2 / count1
Jaccard(1, 2)