I was trying out this example: https://recordlinkage.readthedocs.io/en/latest/notebooks/data_deduplication.html
Following is the code snippet:
import recordlinkage
from recordlinkage.datasets import load_febrl1
dfA = load_febrl1()
# Indexation step
indexer = recordlinkage.Index()
indexer.block(left_on='given_name')
candidate_links = indexer.index(dfA)
compare_cl = recordlinkage.Compare()
compare_cl.exact('given_name', 'given_name', label='given_name')
compare_cl.string('surname', 'surname', method='jarowinkler', threshold=0.85, label='surname')
compare_cl.exact('date_of_birth', 'date_of_birth', label='date_of_birth')
compare_cl.exact('suburb', 'suburb', label='suburb')
compare_cl.exact('state', 'state', label='state')
compare_cl.string('address_1', 'address_1', threshold=0.85,
label='address_1')
features = compare_cl.compute(candidate_links, dfA)
matches = features[features.sum(axis=1) > 3]
print(len(matches))
I would now like to separately print the record_ids that have been matched.I tried listing down the column names of 'matches', but record_id isn't a part of it, and I cannot seem to figure out a way to get it done(I just want the record_ids separately)
Is there a way to retrieve the record_ids, and maybe either print it separately or store it as a list or an array?