In my attribute table, I have 2 columns with qualitative (categorical) data. Both of them are from different sources so I am trying to find the percent of matched data from these 2 columns. I created a new column labeled 'Matched', and wrote the following codeblock in the Field Calculator to determine the values, but I am getting an error on line 2-3. Do I have to convert them to string using
def matchedRecords(x): x = (column.name) x2 = (column2.name) if x == x2: resultIs = "Matched" else: resultIs = "Unmatched" return resultIs
matchedRecords(!Matched!) in the second area of the Field Calculator. I want to determine the total matched values versus unmatched values to find the percentage. Is this the best way to do it? Thanks.