Increase performance in string comparison with sub-dataframes or sub-arrays

Welcome! you should take a look at Please read: make it easier to help you (biggest thing is using ``‍` to make your code be in a code block)