I have two 2d lists: Both are of same size with size unknown (different for different set of lists)
For instance:
A = [['ID', 'Name', 'Profession'], [1, 'Tom', 'Teacher'], [2, 'Dick', 'Actor'], [3, 'Harry', 'Lawyer']]
B = [['ID', 'Name', 'Profession'], [1, 'Tom', 'Police'], [2, 'Dick', 'Actor'], [3, 'Harry', 'Lawyer']]
I want to compare the files element wise (e.g: a[0][1] == b[0][1]
) for all the elements and print the difference with element index.
I would like to have output something like this:
a[1][2] = Teacher <> b[1][2] = Police
It would be great if I could compare the lists using primary key (ID) in case the list is not in order with output as below:
Profession of ID = 1 does not match, i.e Teacher <> Police
Note: file may be very huge (matrix of 100*10000)
Thanks.