I have
dict = {0 : 'red', 1 : 'blue', 2 : 'green'}
label = np.ndarray([0,0,0,1,1,1,2,2,2])
As I want to get value corresponding to key by using label, I called
dict[label]
But I got
TypeError: unhashable type: 'numpy.ndarray'
How can I solve it?
dictas variable name in python