You can use the Python collections module and an Update Cursor to accomplish this. This method adds a new field and populates it with a
1 if there are any duplicates, otherwise a
0 if there are no duplicates.
import arcpy, collections
shp = r'C:\temp\names.shp'
# Add a field called "check" to store binary data.
arcpy.AddField_management(shp, field_name = "check", field_type = "SHORT")
# Use an Update Cursor to query the table and write to new rows
# 1 = has duplicates
# 0 = no duplicates
with arcpy.da.UpdateCursor(shp, ["last_names", "check"]) as cursor:
for row in cursor:
names = row.replace("&", "").split() # Clean the string
counts = collections.Counter(names) #create dictionary to count occurrences of words
if any(x > 1 for x in list([count for name, count in counts.items()])):
row = 1
row = 0