I have a dictionary that has numpy.array() as a values:
dictionary = {0: array([11, 0, 2, 0]), 1: array([ 2, 0, 1, 100]), 1: array([ 5, 10, 1, 100])}
I want to get key of specific value, e.g: [11, 0, 2, 0]. So, I wrote this code:
print(list(a_dictionary.keys())[list(a_dictionary.values()).index([11, 0, 2, 0])])
But it gives me an error: ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
How to handle this? Is there any other way to get a key of specific list value in dictionary?