Possible duplicate of Splitting dictionary/list inside a Pandas Column into Separate Columns – psychemedia Feb 1 '17 at 1:45 add a comment | 3 Answers 3 pandas.DataFrame.to_dict¶ DataFrame.to_dict (self, orient='dict', into=) [source] ¶ Convert the DataFrame to a dictionary. You're going about this the wrong way.

Series.isin (self, values) [source] ¶ Check whether values are contained in Series.

Your data structures are wrong. Dictionaries are meant for forward lookups, not reverse lookups.

The type of the key-value pairs can be …
Return a boolean Series showing whether each element in the Series matches … On top of that, you're doing a reverse lookup on a tuple, which means you have O(n*m) time complexity, where n is the number of keys in the dictionary and m is the average size of each tuple.