I have a dictionary of lookup of values dictionary = {'a': 1, 'b': 2, 'c': 3, 'd': 3}
The result I want from numpy is what pandas.Series.map()
returns after passing in the dictionary. Eg series.map(dictionary, na_action='ignore')
NOTE: This series.map()
function is extremely fast which makes me believe there must be an equivalent in the numpy API rather than me implementing some solution involving numpy.where()
and for looping through the dictionary keys.