Return a boolean Series showing whether each element in the Series matches … Dictionaries are meant for forward lookups, not reverse lookups.

You're going about this the wrong way.

The type of the key-value pairs can be … 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.

pandas.DataFrame.to_dict¶ DataFrame.to_dict (self, orient='dict', into=) [source] ¶ Convert the DataFrame to a dictionary.

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

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