Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python dictionary dot product

dot_product = sum(dict_1[key]*dict_2.get(key, 0) for key in dict_1)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #dictionary #dot #product
ADD COMMENT
Topic
Name
2+6 =