I am using and image scanning API to look for specific images i.e. cat or dog this API tells you the probability of a result in your image. For example an image of a dog would return
{u'dog': 0.99628395, u'cat': 0.87454434}
I want my end result only to take the highest returned value AND only if its above .89 AND below 1.
Code I have so far:
import operator
#define lists
tags = [u'dog', u'cat']
tags_value= [0.99628395, 0.87454434]
#merge key and value pairs
keywords = dict(zip(tags, tags_value))
#check the result
print (keywords)
which gives me
{u'dog': 0.99628395, u'cat': 0.87454434}
I am looking for an end result of
[u'dog']
(notice how the end result is in [] and not {})
Note: if the end result is {u'dog': 0.88628395, u'cat': 0.87454434} then I don't want to return anything because the value is less than .89