Created
May 6, 2012 09:16
-
-
Save varepsilon/2621186 to your computer and use it in GitHub Desktop.
numpy.array scalar product
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 1 | |
sum(x * y for x in a for y in b) | |
# 2 | |
sum([x * y for x in a for y in b]) | |
# 3 | |
a * b | |
# 4 | |
numpy.dot(a, b) | |
# 5 | |
sum(a * b) | |
# 6 | |
a * numpy.transpose(b) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment